PHP Forums

PHP ForumsIn this tutorial I finish the PHP Forum. If you missed the first part it is here PHP Forum Part 1.

This forum isn’t just built in PHP however. It also uses MySQL, JavaScript and JQuery. Watching this tutorial is a great way to see if you understand how to program more complicated sites.

A zipped archive that contains all of the files I used in this tutorial is here PHP Forum Files.

If you find that you need to brush up on any topics, here are links to additional tutorials PHP & MySQL, JavaScript and JQuery.

I specifically didn’t cover 2 topics in this tutorial. I didn’t show you how to create a Forgotten Password Script because I cover that here Forgotten Password Script.

I also didn’t show you how to create the form that would allow people to upload new topics. I didn’t include this because I want to try and force you to make that yourself. It is actually very easy if you just copy the code I present here. If people struggle with it I create it at a later date.

All of the code used follows the video tutorial. Leave questions and comments below.

Code From the Video

configmsgbrd.php

<?php

// Define these as constants so that they can’t be changed

DEFINE (‘DBUSER’, ‘mysqladm’);

DEFINE (‘DBPW’, ‘Turtle2Dove’);

DEFINE (‘DBHOST’, ‘localhost’);

DEFINE (‘DBNAME’, ‘msgbrd’);

 

if ($dbc = mysql_connect (DBHOST, DBUSER, DBPW)) {

 

if (!mysql_select_db (DBNAME)) { // If it can’t select the database.

 

// Handle the error.

 

trigger_error(“Could not select the database!<br />MySQL Error: ” . mysql_error());

 

exit();

 

} // End of mysql_select_db IF.

 

} else {

 

// Print a message to the user, and kill the script.

 

trigger_error(“Could not connect to MySQL!<br />MySQL Error: ” . mysql_error());

 

exit();

 

}

 

// A function that strips harmful data.

function escape_data ($data) {

 

// Check for mysql_real_escape_string() support.

// This function escapes characters that could be used for sql injection

if (function_exists(‘mysql_real_escape_string’)) {

global $dbc; // Need the connection.

$data = mysql_real_escape_string (trim($data), $dbc);

$data = strip_tags($data);

} else {

$data = mysql_escape_string (trim($data));

$data = strip_tags($data);

}

 

// Return the escaped value.

return $data;

 

}

function retrieve_messages() {

global $dbc;

$query = “select m.subject, m.message_txt, u.username, m.date, m.parent_id, m.user_id, m.mess_block, m.topic_id, m.user_id from message AS m, users AS u where (m.user_id = u.user_id) order by m.mess_block, m.date;”;

$result = mysql_query ($query) or trigger_error(“An Error Happened”);

if (mysql_affected_rows() > 0) {

$tagSwitch = FALSE;

while ($messages = mysql_fetch_array($result, MYSQLI_ASSOC)) {

if ($messages[‘parent_id’] == 0)

{

($tagSwitch) ? print ‘</div>’ : print ‘<div class=”commentBox”>’;

$tagSwitch = !$tagSwitch;

echo “<p><h3>{$messages[‘subject’]}</h3></p>”;

echo “<p>{$messages[‘message_txt’]}</p>”;

echo “<br />via: {$messages[‘username’]} <a href=’#’ class=’getComments’>Comments</a><hr />”;

echo “<div class=’comments’>”;

echo “<form id=’theForm’>”;

echo “<textarea name=’comment’ class=’comment’ cols=60 rows=10>Enter Comment…</textarea><br />”;

 

echo “<input type=hidden name=’username’ value={$messages[‘username’]}>”;

 

echo “<input type=hidden name=’subject’ value={$messages[‘subject’]}>”;

 

echo “<input type=hidden name=’parent_id’ value=1>”;

 

echo “<input type=hidden name=’mess_block’ value={$messages[‘mess_block’]}>”;

 

echo “<input type=hidden name=’token_id’ value=$_SESSION[token_id]>”;

 

echo “<input type=hidden name=’topic_id’ value={$messages[‘topic_id’]}>”;

 

echo “<input type=hidden name=’user_id’ value={$messages[‘user_id’]}>”;

 

echo “<button type=’button’ id=’oneButton’>Post Comment</button></form></div>”;

 

} else {

echo “<div class=’comments’>”;

echo “{$messages[‘message_txt’]}<br />”;

echo “via: {$messages[‘username’]}<br /><hr />”;

echo “</div>”;

}

}

}

}

?>

mbforum.php

<?php

include(‘header.html’);

?>

 

<style>

#recaptcha_image img {

width: 185px;

height: 28.5px;

border: 1px solid gainsboro;

}

#recaptcha_widget {

height:400;

}

</style>

 

<script type=”text/javascript” src=”https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js”></script>

 

<script type=”text/javascript”>

// Changes the styling for the Captcha image

var RecaptchaOptions = {

theme : ‘custom’,

custom_theme_widget: ‘recaptcha_widget’

};

 

$(“document”).ready(function() {

 

$(‘#oneButton’).bind(‘click’,sendInfoToServer);

 

$(‘div.comments’).hide();

 

$(‘a.getComments’).click(function() {

 

$(this).siblings(‘div.comments’).toggle();

// $(‘div.comments’).toggle();

 

return false;

 

});

 

function sendInfoToServer() {

 

$(‘span.commentSent’).load(‘sendInfoToServer.php’,

$(‘#theForm’).serializeArray());

}

 

});

</script>

 

<?php

 

if (isset($_POST[‘submitted’])) { // Check if the form has been submitted.

 

// Security check for a valid username

if (preg_match (‘%^[A-Za-z0-9]\S{8,20}$%’, stripslashes(trim($_POST[‘userid’])))) {

 

// Scrub username with function in header.php

$u = escape_data($_POST[‘userid’]);

 

} else {

 

$u = FALSE;

 

echo ‘<p><font color=”red” size=”+1″>Please enter a valid User ID!</font></p>’;

}

 

// Security check for a valid password

 

if (preg_match (‘%^[A-Za-z0-9]\S{8,20}$%’, stripslashes(trim($_POST[‘pass’])))) {

 

// Scrub password with function in header.php

$p = escape_data($_POST[‘pass’]);

 

} else {

 

$p = FALSE;

 

echo ‘<p><font color=”red” size=”+1″>Please enter a valid Password!</font></p>’;

 

}

 

// PHP Code for the CAPTCHA System

 

$captchchk = 1;

 

$privatekey = “PRIVATE KEY HERE”;

$resp = recaptcha_check_answer ($privatekey,

$_SERVER[“REMOTE_ADDR”],

$_POST[“recaptcha_challenge_field”],

$_POST[“recaptcha_response_field”]);

 

if (!$resp->is_valid) {

// What happens when the CAPTCHA was entered incorrectly

echo ‘<p><font color=”red” size=”+1″>The CAPTCHA Code wasn\’t entered correctly!</font></p>’;

$captchchk = 0;

 

 

}

 

// Query the database. Verify the username, password and captcha

 

if ($u && $p && $captchchk) {

 

$query = “SELECT user_id, first_name, last_name, email, username, passwd, active FROM users WHERE username=’$u’ AND passwd=SHA(‘$p’)”;

 

$result = mysql_query ($query) or trigger_error(“Either the Userid or Password are incorrect 1”);

 

if (mysql_affected_rows() == 1) { // A match was made

 

$row = mysql_fetch_array ($result, MYSQL_NUM);

 

mysql_free_result($result);

 

// If they haven’t activated the account redirect

if ($row[6] != NULL)

{

header(“Location: http://localhost/msgbrd/mbforgotpass.php”);

mysql_close(); // Close the database connection.

exit();

}

 

$_SESSION[‘first_name’] = $row[1];

 

$_SESSION[‘userid’] = $row[4];

 

// Create Second Token for security

 

$tokenId = rand(10000, 9999999);

 

$query2 = “update users set tokenid = $tokenId where username = ‘$_SESSION[userid]'”;

 

$result2 = mysql_query ($query2);

 

$_SESSION[‘token_id’] = $tokenId;

 

// Reset session id for security

session_regenerate_id();

 

// Redirect the user

header(“Location: http://localhost/msgbrd/mblogin.php”);

mysql_close(); // Close the database connection.

exit();

}

 

} else { // No match was made.

 

echo ‘<br><br><p><font color=”red” size=”+1″>Either the Userid or Password are incorrect 2</font></p>’;

mysql_close(); // Close the database connection

exit();

}

} // End of SUBMIT

 

?>

 

<body>

<div id=”header”><h2>Message Board</h2></div>

 

<div id=”login”>

 

<?php

echo ‘<h1>Welcome’;

 

if (isset($_SESSION[‘first_name’])) {

echo “, {$_SESSION[‘first_name’]}!”;

}

echo ‘</h1>’;

 

// Display links based upon the login status

// If user is on the logout page disable the login

 

if (isset($_SESSION[‘userid’]) AND (substr($_SERVER[‘PHP_SELF’], -10) != ‘logout.php’)) {

 

echo ‘<a href=”logout.php”>Logout</a><br />

<a href=”change_password.php”>Change Password</a><br />’;

 

} else { // Not logged in.

 

echo ”

 

<form action=’mblogin.php’ method=’post’>

<p><b>Userid:</b> <input type=’text’ name=’userid’ size=’20’ maxlength=’20’ /></p>

<p><b>Password:</b> <input type=’password’ name=’pass’ size=’16’ maxlength=’30’ /></p>”;

 

// Captcha stuff from Google

echo ”

<div id=’recaptcha_widget’ style=’display:none’>

 

<div id=’recaptcha_image’></div>

<div class=’recaptcha_only_if_incorrect_sol’ style=’color:red’>Incorrect please try again</div>

 

<span class=’recaptcha_only_if_image’>Enter the words above:</span><br />

<span class=’recaptcha_only_if_audio’>Enter the numbers you hear:</span>

 

<input type=’text’ id=’recaptcha_response_field’ name=’recaptcha_response_field’ />

 

<div><a href=’javascript:Recaptcha.reload()’>Get another CAPTCHA</a></div>

<div class=’recaptcha_only_if_image’><a href=’javascript:Recaptcha.switch_type(\’audio\’)’>Get an audio CAPTCHA</a></div>

<div class=’recaptcha_only_if_audio’><a href=’javascript:Recaptcha.switch_type(\’image\’)’>Get an image CAPTCHA</a></div>

 

<div><a href=’javascript:Recaptcha.showhelp()’>Help</a></div>

 

</div>

 

<script type=’text/javascript’

src=’http://www.google.com/recaptcha/api/challenge?k=PUBLIC KEY HERE’>

</script>

<noscript>

<iframe src=’http://www.google.com/recaptcha/api/noscript?k=PUBLIC KEY HERE’

height=’300′ width=’500′ frameborder=’0′></iframe><br>

<textarea name=’recaptcha_challenge_field’ rows=’3′ cols=’40’>

</textarea>

<input type=’hidden’ name=’recaptcha_response_field’

value=’manual_challenge’>

</noscript>

“;

 

echo “<div align=’left’><input type=’submit’ name=’submit’ value=’Login’ /></div>

<input type=’hidden’ name=’submitted’ value=’TRUE’ />

</form>”;

 

echo ‘<a href=”register.php”>Register</a><br />

<a href=”forgot_password.php”>Forgot Password</a><br />’;

 

}

?>

 

</div>

 

<div id=”main”>

 

<span class=’commentSent’></span>

 

<?php

 

if (isset($_SESSION[‘first_name’])) {

$sql = “SELECT tokenid from users where username = ‘$_SESSION[userid]'”;

$result = mysql_query($sql) or trigger_error(“You’re not logged in”);

if (mysql_affected_rows() == 1) { // A match was made.

$row = mysql_fetch_array ($result, MYSQL_NUM);

mysql_free_result($result);

retrieve_messages();

if($_SESSION[‘token_id’] == $row[0]){

$loggedin = 1;

} else {

header(“Location: http://localhost/msgbrd/mblogin.php”);

mysql_close(); // Close the database connection.

exit();

}

}

}

?>

</div>

</body>

</html>

sendInfoToServer.php

<?php

require_once(‘configmsgbrd.php’);

 

$u = escape_data($_POST[“user_id”]);

$tid = escape_data($_POST[“topic_id”]);

$mt = escape_data($_POST[“comment”]);

$pid = escape_data($_POST[“parent_id”]);

$mb = escape_data($_POST[“mess_block”]);

$token = escape_data($_POST[“token_id”]);

 

$query1 = “SELECT user_id, tokenid FROM users WHERE (user_id=’$u’) AND (tokenid=’$token’)”;

 

$result2 = mysql_query ($query1) or trigger_error(“An Error Occurred”);

 

if (mysql_affected_rows() == 1) {

 

$query2 = “INSERT INTO message (user_id, topic_id, message_txt, date, parent_id, mess_block) VALUES (‘$u’, ‘$tid’, ‘$mt’, NOW(), ‘$pid’, ‘$mb’)”;

 

$result2 = mysql_query ($query2) or trigger_error(“An Error Occurred”);

 

echo “Comment Has Been Submitted”;

exit();

mysql_close();

 

} else {

echo “Comment Has Been Declined”;

exit();

mysql_close();

}

?>

54 Responses to “PHP Forums”

  1. Jerry says:

    I have watched a lot of PHP videos, but yours are the best and most informative. For a beginner they are very easy to follow.

    I have watched tutorials on pagination, but on one can explain how to paginate when a query is performed on a database. Every paginate tutorial I have found will display the entire contents of the database.
    Any idea?

    Thanks, keep up the good work

    • admin says:

      I would accomplish what you want to do by having php issue a query to grab everything you want to show. It would then say list the first 10 rows in a table.

      Then create links that trigger JQuery / JavaScript code that dynamically changes the values in the table. It’s really not that hard.

      I’m not sure if you wanted to see the code or just get a description of how I’d do it. Here is a link on how you can use Ajax with JQuery.

      I hope that helps? If you need more help just ask. Thanks

    • Anonymous says:

      may u please provide us Yii framework tutorial

  2. Jani says:

    Hey and thank you for these tutorials! People do watch these, trust me!

    I have problem: If I had several subjects (added by manually in phpMyAdmin) then the “Post Comment” thing works only with first subject (mess_block). Do you have any idea what i’ve done wrong?

    And I’ve been trying to get that “add subject” property, but I can’t. So do you have any tips or tutorial for that. I have been spendin lot of time for this project and it would be very nice to end it with succes.

    Once more, thanks a lot!

    -Jani from Finland-

    • admin says:

      Hi Jani

      I won’t be able to get to that very quickly, but this is the statement you need to understand to provide the user with the ability to add new topics.

      $query = “select m.subject, m.message_txt, u.username, m.date, m.parent_id, m.user_id, m.mess_block, m.topic_id, m.user_id from message AS m, users AS u where (m.user_id = u.user_id) order by m.mess_block, m.date;”;

      You not only need to add a new topic but all of the above proceeded by an m. You’re problem is probably found in that you didn’t set up m.parent_id properly.

      Tell me if that helps

  3. Andrew says:

    Thanks for these great tutorials, really appreciate someone spending the time to educate beginners in PHP/MySQL.

    I have followed faithfully your tutorial about the PHP Forum and downloaded the files that accompany the video. However, no matter what I do I simply cannot login (using mblogin.php), even though the account was successfully activated. The login form always resets itself as blank and when I refresh the page it says “Either the Userid or Password are incorrect 2” (And they are correct)? I spent the best part of yesterday going over the code line by line to try and find an error but find myself completely lost in solving the issue! I had a look at my php error log (below) but cannot figure out what is wrong? Any suggestions or bug detection methods using Terminal or something else? I am on a Mac using MAMP.

    [20-Sep-2011 12:04:38] PHP Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /Applications/MAMP/htdocs/msgbrd/mblogin.php:2) in /Applications/MAMP/htdocs/msgbrd/header.php on line 9
    [20-Sep-2011 12:04:49] PHP Warning: session_start() [function.session-start]: Cannot send session cache limiter – headers already sent (output started at /Applications/MAMP/htdocs/msgbrd/mblogin.php:2) in /Applications/MAMP/htdocs/msgbrd/header.php on line 9

    • admin says:

      Make sure that your user database is set up like this

      +———–+———————–+——+—–+———+—————-+
      | Field | Type | Null | Key | Default | Extra |
      +———–+———————–+——+—–+———+—————-+
      | user_id | mediumint(8) unsigned | NO | PRI | NULL | auto_increment |
      | lang_id | tinyint(3) unsigned | NO | | NULL | |
      | time_zone | varchar(30) | NO | | NULL | |
      | username | varchar(30) | NO | UNI | NULL | |
      | pass | char(40) | NO | | NULL | |
      | email | varchar(60) | NO | UNI | NULL | |
      +———–+———————–+——+—–+———+—————-+

      That is where most errors seem to lie for other people that have contacted me about this tutorial. I hope that helps

      • Derek, what can I say?, you’re the man! These tutorials are great and after two weeks of spending every free moment I have trying to work through them, I finally feel as though I can really learn to script.

        Just like Andrew, I’ve spent several hours this evening trying to figure out why my login page keeps refreshing, but not showing the “Welcome Nick!” (and appropriate links) message that I want to see so badly, but unfortunately, I’m completely stumped. I stripped out the recaptcha for the login page, but I don’t think that’s the issue. I’m still very new at this, but in order to try to trace the breakdown, I inserted simple echo statements to print each step of the way and as best as I can tell the query for $result isn’t executing. My first thought was that the database connection was failing, but when I test the connection in the configmsbrd.php file, it’s successful. I also tried adding the $dbc variable in the mysql_query to ensure the connection, but that didn’t seem to make any difference. My final idea was to echo out the User_ID to see if the query was executing, but no results are being returned. Still if the query is failing, I don’t know why the trigger_error isn’t triggering the “Either the userid….” message.

      • Here’s my code:
        (Also, I know my table rows are labeled slightly different than the labels that you use in the tutorials, but I’ve double and triple checked that those used in the code match those in my db; Running XAMPP 1.7.4 if that helps)

        <?php

        if (isset($_POST['submitted'])) // Check if the form has been submitted.
        { // Security check for a valid username
        if (preg_match ('%^[-_a-zA-Z ]{2,30}$%', stripslashes(trim($_POST['userid']))))
        {
        // Scrub username with function in header.php
        $u = escape_data($_POST['userid']);
        } else
        {
        $u = FALSE;
        echo 'Please enter a valid User ID!’;
        }

        // Security check for a valid password
        if (preg_match (‘%^[A-Za-z0-9]\S{8,20}$%’, stripslashes(trim($_POST[‘pass’]))))
        {
        // Scrub password with function in header.php
        $p = escape_data($_POST[‘pass’]);
        } else
        {
        $p = FALSE;
        echo ‘Please enter a valid Password!’;
        }

        // Query the database. Verify the username and password
        if ($u && $p)
        {
        $query = “SELECT User_ID, First_Name, Last_Name, Email, Username, PW, Active FROM user WHERE Username=’$u’ AND PW=SHA(‘$p’)”;
        $result = mysql_query($query, $dbc) or trigger_error(“Either the Userid or Password are incorrect”);
        echo $result[‘User_ID’];*/

        if (mysql_affected_rows() == 1)
        { // A match was made
        $row = mysql_fetch_array ($result, MYSQL_NUM);
        mysql_free_result($result);

        // If they haven’t activated the account redirect
        if ($row[6] != NULL)
        {
        echo ‘You\’re account hasn\’t been activated yet.’;
        mysql_close(); // Close the database connection.
        exit();
        }

        // Create Second Token for security
        $_SESSION[‘First_Name’] = $row[1];
        $_SESSION[‘userid’] = $row[4];
        $tokenId = rand(10000, 9999999);
        $query2 = “UPDATE user SET Token_ID = $tokenId WHERE Username = ‘$_SESSION[userid]'”;
        $result2 = mysql_query($query2);
        $_SESSION[‘tokenid’] = $tokenId;

        // Reset session id for security
        session_regenerate_id();

        // Redirect the user
        header(“Location: http://localhost/mblogin2.php“);
        mysql_close(); // Close the database connection.
        exit();

        }

        }
        else
        { // No match was made.
        echo ‘Either the Userid or Password are incorrect’;
        mysql_close(); // Close the database connection
        exit();
        }

        } // End of SUBMIT

        ?>

        Message Board

        <?php

        echo 'Welcome’;

        if (isset($_SESSION[‘First_Name’]))
        {
        echo “, {$_SESSION[‘First_Name’]}!”;
        }

        echo ”;

        // Display links based upon the login status
        // If user is on the logout page disable the login
        if (isset($_SESSION[‘userid’]) AND (substr($_SERVER[‘PHP_SELF’], -10) != ‘logout.php’))
        {
        echo
        Logout
        Change Password‘;
        }
        else
        { // Not logged in.
        echo

        Userid:
        Password: “;

        echo

        “;

        echo
        Register
        Forgot Password‘;
        }

        ?>

      • Nick says:

        I posted a comment on Saturday night asking for help and said that I thought that I was having a problem with a mysql_query not connecting to my data base and I finally realized this morning that, that is not my problem. I still haven’t fixed my code completely, but I have found it is somehow related to retrieving the sha(‘$p’). I had to set this down to go to work, but I have some ideas on what to try. I can’t remember if the db was set to store 40 char for the password when it was generated so I’ll try truncating the table and then deactivating the account. Anyway, just wanted to follow up so that I don’t unnecessarily waste your time.

        • admin says:

          Here is the database table

          +———–+———————–+——+—–+———+—————-+
          | Field | Type | Null | Key | Default | Extra |
          +———–+———————–+——+—–+———+—————-+
          | user_id | mediumint(8) unsigned | NO | PRI | NULL | auto_increment |
          | lang_id | tinyint(3) unsigned | NO | | NULL | |
          | time_zone | varchar(30) | NO | | NULL | |
          | username | varchar(30) | NO | UNI | NULL | |
          | pass | char(40) | NO | | NULL | |
          | email | varchar(60) | NO | UNI | NULL | |
          +———–+———————–+——+—–+———+—————-+

          I’m not sure what could be going wrong. This code isn’t fresh in my mind since I wrote it so long ago. Sorry about that. I just tested it on my machine and everything worked. Have you tried issuing queries through the mysql terminal directly? It is better to rule out there being a problem with the database setup first. I hope that helps

          • Nick says:

            This is too late for Andrew I’m sure, but I was able to get the welcome message to appear by truncating the userids I created in the first 2 tutorials, then altering the password field to hold 40 characters. I’m not sure if this is a common mistake or not, but in case anyone comes across this in the future (and Derek please correct me if I’m wrong), the encrypted password that the SHA function passes to the database is 40 characters.

            • admin says:

              You are definitely right. The encrypted password is 40 characters long. I’m very sorry that I didn’t point that out better in the tutorial. Thank you for pointing that out

  4. I’m stuck with relative path issue. My folder structure is
    |
    +—- /includes
    | |
    | +—-function.php (creates navigation for site)
    +—-/public
    |
    +—– page.php (has a link generated by functions.php)
    |
    +—— /admin
    |
    +—— adminpage.php (has the same link generated by functions.php)

    The links created for adminpage.php are not working on page.php vice-e-verse. Please help.

    • admin says:

      This tutorial was kind of a crazy thing to create. It was really made just to teach programming concepts and not really to be a ready for prime time forum. What error did you get? It works with the included code, so I’m guessing you made some changes to the original code. I’ll help the best that I can

  5. Andrew says:

    Thank you for all the time u took to create these tutorials.Helped me a lot.Best tutorials i have ever found..

  6. Peter says:

    Hi and thank’s for the tuts!
    My problem occurs when I echo out several textareas and buttons with same ID’s and name atributes. It seems that jQuery couldn’t function at all when it is so.

    If I had (for example 4 different subjects and try to write a comment under the third subject -> jQuery always select the text of first subject (“you can write comment here…”) and places 1 for value of “mess_block” -field and stores that combination into database..

    As I said, problem seems to be in jQuery Code, but can’t find out why…

    • admin says:

      You’re very welcome. You shouldn’t use the same class names for different nodes if you ever want to target them individually. Actually ids are only ever supposed to target one node. That is why your having trouble with your code. Just some basic rules and nothing that complicated.

      • PETER says:

        But I understand that is indeed the case when use the
        “function retrieve_messages()” and echo out every mess_block with textarea and submit -button. When those are listed into page, every textarea has same atribute value and same is with submit buttons…

        There must be something what I don’t understand with this last tutorial…

        • admin says:

          This tutorial was done to describe the basics behind creating a PHP forum from scratch. It isn’t by any means perfect, but was a starting off point. Nobody seemed to be interested in it when I made it so I cut some corners here and there.

          Sorry about that. When you run a site like I do you have to sometimes make a decision on whether you should devote a month to a tutorial that people don’t seem to like. I finished this, but definitely didn’t perfect it

  7. Luc says:

    Please can you make a tutorial for integrating invisionpower or phpbb in a custom website? So if I have a theme made from scratch and want to add a new button(section) let’s say forum.
    And there have a invisionpower or phpbb forum (and maybe some customization , how to add permissions to users could be great).
    Thank you! Keep up the good work!

  8. wishwayn says:

    hi again sir,

    do i need a internet connection to call the
    ???

    thanks for the reply.

  9. wishwayn says:

    hi again sir,

    do i need a internet connection to call the //
    ???

    how can i use that without using a internet.

    thanks for the reply.

  10. wishwayn says:

    hi again sir,

    my questions are:
    do i need a internet connection to call the //
    ???

    how can i use that without using a internet.

    thanks for the reply.

  11. wishwayn says:

    hi again sir,

    resend:
    do i need a internet connection to call the //script type=”text/javascript” src=”http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js”>/script
    ???

    how can i use that without using a internet.

    thanks for the reply.

  12. wishwayn says:

    hi again sir,

    in the last part of your tutorial. wich is the comment section. when i click the post comment,nothing happens. the comment dont send. there is no error,the problem is the that when i want to post a comment,my commet does not send. what could be the error? if its ok if i remove the jquery? please reply. thankyou again.

  13. wishwayn says:

    hi again sir,

    i need help about your php message board tutorial on the last part wich is the comment section. my problems are;
    when i type a comment and click the post comment btn nothing happens. what do you think went wrong? i just used all the codes in this part of your tutorial and i did not change any thing from it except the my database connection on the configmsg.php. and i downloaded the jquery so that even if i have no internet connection i can use it.

    thankyou for the reply.

    • admin says:

      I can’t imagine what may be happening. I’m guessing there may be a problem still because you don’t have the captcha set up nor do you have an internet connection. I don’t think I’ve asked you what OS you are using, or what Apache set up you are using? Using tools like WAMP can sometimes cause all kinds of errors that are hard to figure out

  14. wishwayn says:

    hi again sir,

    im using windows 7 and xampp phpmyadmin. i try using the internet to with the captcha but the problem still the same. nothing happens when i click the post comment button. please help me sir. thankyou for the reply.

    • admin says:

      xampp is your problem. It is extremely buggy. I’d estimate that 65% of the problems I receive are based off of people using either xampp, wamp, or mamp. It is better to develop on a Ubuntu system that will work like the server you’ll ultimately develop on.

      With this you can install Ubuntu just like any other application on Windows.

      Installing things like Apache, PHP, etc. are done easily. That will probably solve a bunch of problems today and tomorrow.

      I hope that helps – Derek

  15. wishwayn says:

    hi again sir,

    is there any other option sir? instead of changing my os?
    thanks for the reply.

  16. wishwayn says:

    hi again sir,

    is that free sir?

  17. wishwayn says:

    hi again sir,

    after installing the wubi. what will i do next?
    thank you for the reply.

    • admin says:

      Install apache and everything else you need. Most everything is preinstalled. If you learn how to do this you’ll be able to make really great sites on a real web server

  18. wishwayn says:

    hi again sir,

    im having a trouble in running php script.
    it shows black pages.
    i try to test it using php info and it works.
    but the problem is when im using another script it shows blank.
    im using ubuntu 12.10.
    please reply
    thankyou sir.

    • admin says:

      You may want to brush up on your php. How much experience do you have using php? I have a big tutorial on it here PHP and MySQL Video Tutorial. This is a some what complicated project to jump into unless you have a pretty solid understanding of PHP. I hope that helps

      • wishwayn says:

        hi again sir,

        how to change this script —

        // Changes the styling for the Captcha image
        var RecaptchaOptions = {
        theme : ‘custom’,
        custom_theme_widget: ‘recaptcha_widget’
        };

        $(“document”).ready(function() {

        $(‘#oneButton’).bind(‘click’,sendInfoToServer);

        $(‘div.comments’).hide();

        $(‘a.getComments’).click(function() {

        $(this).siblings(‘div.comments’).toggle();
        // $(‘div.comments’).toggle();

        return false;

        });

        function sendInfoToServer() {

        $(‘span.commentSent’).load(‘sendInfoToServer.php’,
        $(‘#theForm’).serializeArray());
        }

        });

        — if im not using internet connection. please help. the problem is the jquery and the click post button.

        • admin says:

          f you delete everything that follows these comments, it should work

          // Changes the styling for the Captcha image

          // PHP Code for the CAPTCHA System

          // Captcha stuff from Google

  19. Sandy says:

    I’m setting up a site for the family to post updates and events. Since not all the family is on Facebook. This has been a great tutorial and easy to follow. It’s been a while since I took classes but you explain things well enough I can pick up. 🙂 Thank you.

  20. Rady LIM says:

    That’s good tutorial !!! Thank you so much

  21. Paul Ayuk says:

    Please Sir can u teach how to use google maps and twitter api?

Leave a Reply

Your email address will not be published.

Google+