Members

Technology Zones

Articles

Hosted By

MaximumASP

Info

[3423] Using PHP and IIS to Create a Discussion Forum

Last post 08-20-2007 11:16 AM by CLICSARGENT. 37 replies.
Page 3 of 3 (38 items) < Previous 1 2 3
Sort Posts: Previous Next
  • 11-18-2004 3:01 AM In reply to

    • aswell
    • Not Ranked
    • Joined on 11-18-2004
    • New Member
    • Points 10
    Hi, did you ever get this problem fixed as I have the same one! Please email the reply to me as well as to the group.

    ashnook@o2.co.uk

    Cheers
    Brian


    Quote:
    [1]Posted by roccotaco on 12 Nov 2004 06:17 AM[/1]
    i've tried your forum tutotial but i get this error read when i try and access the page:

    Warning: odbc_connect() [function.odbc-connect]: SQL error: , SQL state 00000 in SQLConnect in c:\Inetpub\wwwroot\worstmetteamever\forum\index.php on line 3
    Discussion Forum using PHP/Access under IIS

    Post New Message
    Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in c:\Inetpub\wwwroot\worstmetteamever\forum\index.php on line 20


    Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in c:\Inetpub\wwwroot\worstmetteamever\forum\index.php on line 22

    i had previously installed php w/ iis and i think i need to wipe php off my system and start over again.  what files did i need to erase  besides going to add/remove programs?

    thanks for any help!
    • Post Points: 0
  • 11-18-2004 3:02 AM In reply to

    • aswell
    • Not Ranked
    • Joined on 11-18-2004
    • New Member
    • Points 10
    Hi, did you ever get this problem fixed as I have the same one! Please email the reply to me as well as to the group.

    ashnook@o2.co.uk

    Cheers
    Brian
    • Post Points: 0
  • 02-03-2005 3:04 PM In reply to

    • blogfart
    • Not Ranked
    • Joined on 11-22-2004
    • New Member
    • Points 10

    LAMP Forum solution (revised article code)


    I've amended the code to 1) work 2) work with MySql (see table at bottom)

    forum.php:
    Code:

    <? # original code Jayesh Jain, amends by me, still needs form input validation, etc
    include("connect.php"); # Your connection details?>
    <HTML>
    <BODY>
    Discussion Forum using PHP/<s>Access</s> MySql under <s>IIS</s> Apache<BR>
    <BR>
    <A HREF='node.php?node=0'>Post New Message</A>
    <?

    shownode(0); // display all the main threads

    // This function is a recursive function which shall display all the branches
    // and sub branches of the threads
    function shownode($nodecode) {
      global $link; // using the global variable for connection
      // Get a list of all the sub nodes which specific parentcode
      #$noderesult = odbc_exec($connect,"select * from forum where parentcode = $nodecode");
     
      $sql = "SELECT code, title, uname, email FROM forum WHERE parentcode = '$nodecode'";
      $result = mysql_query($sql);
     
      echo "<UL type='disc'>";
      while(list($code, $title, $uname, $email) = mysql_fetch_row($result)) {
          echo "<LI>";
          echo "<A HREF='node.php?node=$code'> $title </A>";
          echo "-- by ($uname) $email<BR>";
          shownode($code);
      }
      echo "</UL>";
    }?>
    </BODY>
    </HTML>

    node.php:
    Code:

    <? # original code Jayesh Jain, amends by me, still needs form input validation, etc
    include("connect.php"); # Your connection details

    $submit = $_POST[submit];
    if(isset($submit)) // check if submitted button is clicked
    {
      // insert the record in the database
      $sql = "INSERT INTO forum (parentcode,title,description,uname,email) VALUES ('$_POST[node]','$_POST[title]','$_POST[description]','$_POST[postname]','$_POST[email]')";
      #echo "<br>".$sql."<br>";
      $result = mysql_query($sql);
     
      header("location:forum.php"); // open forum.php file to display the thread
    }
    ?>
    <CENTER>Post to Discussion Forum using PHP/<s>Access</s> MySql under <s>IIS</s> Apache</CENTER>
    <?
    $node = $_GET[node];
    if ( $node != 0 ){
      // Displaying the details of the thread
      echo "<HR>";
     
      $sql = "SELECT code, title, uname, email FROM forum WHERE code = '$node'";
      #echo "<br>".$sql."<br>";
      $result = mysql_query($sql);
      list($code,$title,$uname,$email) = mysql_fetch_row($result);?>
      <?=$title?> by (<?=$uname?> <?$email?><BR>
      <?=$description?>
      <BR>
      <HR>
    <?}?>
    <!-- Form to enter the message -->
    <FORM method='post' action='node.php'>
    Name : <INPUT TYPE=TEXT NAME=postname> <BR>
    E-Mail : <INPUT TYPE=TEXT NAME=email> <BR>
    Title : <INPUT TYPE=TEXT NAME=title VALUE = '' size=50> <BR>
    Description : <BR> <TEXTAREA name=description rows=10 cols=45></TEXTAREA>
    <!-- we need a hidden field to store the node -->
    <INPUT TYPE=hidden NAME=node value='<? echo $_GET[node];?>'> <BR>
    <INPUT type=submit name=submit value='Post Message'>
    </FORM>

    and finally MySql table (as original, really):

    #
    # Table structure for table `forum`
    #

    CREATE TABLE forum (
     code int(11) NOT NULL auto_increment,
     parentcode int(11) NOT NULL default '0',
     title text NOT NULL,
     description text NOT NULL,
     uname text NOT NULL,
     email text NOT NULL,
     UNIQUE KEY code (code)
    ) TYPE=MyISAM;
    • Post Points: 0
  • 06-21-2005 1:23 AM In reply to

    • mitho7
    • Not Ranked
    • Joined on 06-21-2005
    • New Member
    • Points 15

    it is alos working with php4isapi.dll

    I added php4isapi.dll for executeable it's working fine but one problem if i try to access my .php file by typing the the actual url (like www.abtcom.com.au/index.php ) it is asking me for user name and password. But it is not asking me for the .html file. does any one know what is the reason?

    i could not find any clue for that.

    • Post Points: 0
  • 06-30-2005 12:44 PM In reply to

    • srisamir
    • Not Ranked
    • Joined on 06-30-2005
    • New Member
    • Points 5

    PHP as a module

    If we install the php binary then the PHP will run as binary. But I want to run it as a module. Please help me with necessary infomation.
    • Post Points: 0
  • 08-23-2005 8:43 PM In reply to

    • agent3x3
    • Not Ranked
    • Joined on 08-23-2005
    • New Member
    • Points 5
    I check the node.php file and the the above line of code are exactly the same.  I still get the same error "Notice: Undefined variable: node in c:\Inetpub\wwwroot\node.php on line 15".  The error is in the line if ( $node != 0 ).  I jus want to see how a simple forum works.  Thanks for your help.
    • Post Points: 0
  • 03-08-2007 5:23 PM In reply to

    • evanc
    • Not Ranked
    • Joined on 03-08-2007
    • New Member
    • Points 5

    Re: [3423] Using PHP and IIS to Create a Discussion Forum

    People might want to note that you must have PHP version 4 for this to work, it will not work for version 5.  I think if php.exe is replaced with php-win.exe it might work in version 5.

    • Post Points: 5
  • 08-20-2007 11:16 AM In reply to

    • CLICSARGENT
    • Not Ranked
    • Joined on 08-20-2007
    • United Kingdom
    • New Member
    • Points 10

    Re: [3423] Using PHP and IIS to Create a Discussion Forum

    Hi

    I've gone through the instructions to install PHP and test, create the access database, add the two PHP files and then test the forum.

     

    I can access forum.php fine and input data into node.php but when I click on 'Post Message' my inputted text disappears and nothing is written to the Access database?  I thought it may have been a permissions issue but both 'Everyone' and the 'IUSR' account have Full Control NTFS permissions to the Access database?

    I've tried using both version 4 and version 5 of PHP but get the same problem?

    Can you advise?

    Thanks!

    • Post Points: 5
Page 3 of 3 (38 items) < Previous 1 2 3