Jump to content

Linux_BSD_Unix

Members
  • Posts

    13
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Linux_BSD_Unix's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Okay, I got my problem fixed i think with that tutorial I was doing. But now I need help. Could someone tell me how I would go about adding catagories to the forum so it will have catagories? This is a major feature I need that and registration, but I am in more need of it to have catagories. Could someone guide me?
  2. Yeah, it wa slike that, but when I save it it changes back to that and gives me that error. I don't know whats wrong. I tihnk it has something to do with my websites CP?
  3. Okay, I was trying two tutorials on creating my own forum. The first one I posted in the wrong forum, so I tihnk I'll post this one in the correct forum. I want to get the two forums up to see which I like better. With this tutorial: http://www.tutorialized.com/tutorial/Discussion-Forums-with-PHP/609 I did everything. Uploaded the files, created the tables using phpMyAdmin. But I get this error when I try to access the board: [code] Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home2/linuxmf/public_html/board/functions.php3 on line 105 [/code] Here's the functions.php3 code: [code] <?php mysql_connect("localhost","linuxmf_board1","012089"); mysql_select_db("linuxmf_board"); function showheader($title) { ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <TITLE> <?php echo $title ?> </TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF"> <?php } function showfooter() { ?> </BODY> </HTML> <?php } function viewpost ($topicID) { $topic_query = mysql_query("SELECT TopicName FROM topics WHERE (ID=$topicID)"); $topic = mysql_fetch_array($topic_query); ?> <TABLE BORDER=0 WIDTH=100% CELLSPACING=3 CELLPADDING=5> <TR> <TD> <FONT COLOR="#000000" FACE="Arial,Verdana,Helvetica" size=-1> <b>Topic: </b> <BR><?php echo $topic['TopicName'] ?> <P> <a href="index.php3"><FONT COLOR="#000000">Return Back to Topic Listing</a> <P> <a href="add-post.php3?topicID=<?php echo $topicID ?>"><FONT COLOR="#000000">Make a Post</a> </TD> </TR> </TABLE> <P> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=100%> <TR VALIGN=TOP ALIGN=LEFT> <TD WIDTH=100%> <TABLE BORDER=0 BGCOLOR="#000000" CELLSPACING=1 CELLPADDING=1 WIDTH=100%> <TR> <TD COLSPAN=3 BGCOLOR="#C0C0C0" WIDTH=100%> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH=100%> <TR> <TD> <P><B><FONT COLOR="#000000" FACE="Trebuchet MS,Arial,Helvetica">Topic Posts</FONT></B> </TD> </TR> </TABLE> </TD> </TR> <?php $post_query = mysql_query("SELECT * FROM posts WHERE (TopicID='$topicID') ORDER BY TimeStamp"); while ($post = mysql_fetch_array($post_query)) { ?> <TR> <TD WIDTH=82% BGCOLOR="#FFFFFF" HEIGHT=28 VALIGN=TOP> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH=100%> <TR> <TD> <P><FONT SIZE="-1" FACE="Trebuchet MS,Arial,Helvetica"><?php echo $post['Post'] ?></FONT> </TD> </TR> </TABLE> </TD> <TD WIDTH=18% BGCOLOR="#C0C0C0" VALIGN=TOP> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH=100% > <TR> <TD> <P ALIGN=center><FONT SIZE="-1" FACE="Trebuchet MS,Arial,Helvetica" color=#000000>Posted By: <A HREF="mailto:<?php echo $post['Email'] ?>"> <FONT COLOR=#000000><?php echo $post['Name'] ?></A> <BR><BR> <A HREF="edit-post.php3?postID=<?php echo $post['ID'] ?>"><FONT COLOR=#000000>Edit Your Post</FONT> <BR><BR> <A HREF="delete-post.php3?postID=<?php echo $post['ID'] ?>"><FONT COLOR=#000000>Delete Your Post</FONT> </TD> </TR> </TABLE> </TD> </TR> <?php } if (mysql_num_rows($post_query) < 1) { ?> <TR height=300> <TD WIDTH=100% BGCOLOR="#FFFFFF" HEIGHT=28 VALIGN=TOP colspan=2> <CENTER><FONT SIZE="-1" FACE="Trebuchet MS,Arial,Helvetica"> <BR><B>There Are No Posts Currently For This Topic</B><BR><BR></CENTER> </TD> </TR> <?php } ?> </TABLE> </TD></TR> </TABLE> <?php } function addpost () { global hj3lsm/bf[@,$email,$name,$post,$topicID; $timestamp = time(); $new_password = addslashes($password); $new_email = addslashes($email); $new_name = addslashes($name); $new_post = addslashes(nl2br(htmlspecialchars($post))); $insert = mysql_query("INSERT INTO posts VALUES ('NULL','$topicID','$new_name','$new_email','$new_password','$timestamp','$new_post')"); if (mysql_error() != "") { showheader("MySQL Error ".mysql_error()); ?> <br><p><center><b>There was a MySQL Error -- <?php echo mysql_error() ?></b></center></p> <?php showfooter(); exit; } } function editpost () { global $postID,$post; $new_post = addslashes(nl2br(htmlspecialchars($post))); $insert = mysql_query("UPDATE posts SET post='$new_post' WHERE (ID='$postID')"); if (mysql_error() != "") { showheader("MySQL Error ".mysql_error()); ?> <br><p><center><b><FONT SIZE="-1" FACE="Trebuchet MS,Arial,Helvetica">There was a MySQL Error -- <?php echo mysql_error() ?></b></center></p> <?php showfooter(); exit; } } function deletepost () { global $postID; $post_query = mysql_query("DELETE FROM posts WHERE (ID='$postID')"); if (mysql_error() != "") { showheader("MySQL Error ".mysql_error()); ?> <br><p><center><b><FONT SIZE="-1" FACE="Trebuchet MS,Arial,Helvetica">There was a MySQL Error -- <?php echo mysql_error() ?></b></center></p> <?php showfooter(); exit; } } function addtopic () { global $topicname; $new_topicname = addslashes($topicname); $topic_query = mysql_query("INSERT INTO topics VALUES ('NULL','$new_topicname')"); if (mysql_error() != "") { showheader("MySQL Error ".mysql_error()); ?> <br><p><center><b><FONT SIZE="-1" FACE="Trebuchet MS,Arial,Helvetica">There was a MySQL Error -- <?php echo mysql_error() ?></b></center></p> <?php showfooter(); exit; } return mysql_insert_id(); } ?> [/code] BTW< I want to thank this community for helping me. You guys are really great. I love this site. Thanks for being so generous and helping me through these, probably, "boring" problems of mine. Thanks again guys! :)
  4. I tihnk I fixed it. What do you think? http://www.linux.mfhosting.com/phpBulletin/ But the index.php file, notihng comes up, but when you try the viewforum.php viewthread.php addthread.php addreply.php Those work, but these don't index.php Notihng for database.php comes up and I made a new folder called "admin" for these: add_forum.php add_catagory.php But I get these errors for add_catagory.php: [code] Warning: main(database.php) [function.main]: failed to open stream: No such file or directory in /home2/linuxmf/public_html/phpBulletin/admin/add_category.php on line 3 Warning: main(database.php) [function.main]: failed to open stream: No such file or directory in /home2/linuxmf/public_html/phpBulletin/admin/add_category.php on line 3 Warning: main(database.php) [function.main]: failed to open stream: No such file or directory in /home2/linuxmf/public_html/phpBulletin/admin/add_category.php on line 3 Warning: main() [function.include]: Failed opening 'database.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home2/linuxmf/public_html/phpBulletin/admin/add_category.php on line 3 [/code] and add_forum.php won't even open in my browswer. http://www.linux.mfhosting.com/phpBulletin/ is the forums main URL to access the other forum files.
  5. When I replaced that code whith that new one I listed I get this error: [code] Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'linuxmf_php1@localhost' (Using password: YES) in /home2/linuxmf/public_html/phpBulletin/database.php on line 5 I cannot connect to the database because: Access denied for user: 'linuxmf_php1@localhost' (Using password: YES) [/code] Oh, I'm sorry that its in the wrong forum. I didn't realize. It should be moved then.
  6. Yea I have added a username and password. Okay I'll do that. :) [b]database.php[/b] [code] <? // 1st expression is the server, usually "localhost" // 2nd expr. is the username // 3rd expr. is the password mysql_connect("localhost", "username", "password"); // this one defines our database name. mysql_select_db("database"); ?> [/code] The database I made in MySQL of the CP is: linuxmf_phpBulletin The username I created for it was: linuxmf_php1 Also, under the database in MySQL of the CP it says this, besides PHP I wonder if I just replace it with the code in dtabase.php: $dbh=mysql_connect ("localhost", "linuxmf_php1", "<PASSWORD HERE>") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("linuxmf_phpBulletin"); would I use that and replace it over mysql_connect("localhost", "username", "password"); // this one defines our database name. mysql_select_db("database"); that part of dtatbase.php file?
  7. I used phpMyAdmin, like you said and created the tables and stuff....but now i got this error when trying to view the forum: [code] Warning: mysql_connect() [function.mysql-connect]: Access denied for user: 'username@localhost' (Using password: YES) in /home2/linuxmf/public_html/phpBulletin/database.php on line 5 Warning: mysql_select_db() [function.mysql-select-db]: Access denied for user: 'nobody@localhost' (Using password: NO) in /home2/linuxmf/public_html/phpBulletin/database.php on line 7 Warning: mysql_select_db() [function.mysql-select-db]: A link to the server could not be established in /home2/linuxmf/public_html/phpBulletin/database.php on line 7 Warning: mysql_query() [function.mysql-query]: Access denied for user: 'nobody@localhost' (Using password: NO) in /home2/linuxmf/public_html/phpBulletin/index.php on line 6 Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home2/linuxmf/public_html/phpBulletin/index.php on line 6 Access denied for user: 'nobody@localhost' (Using password: NO) [/code] I uploaded the .sql file in the forums main directory. But in my sites admin cp I have this as a MySQL database I made: linuxmf_phpBulletin and then the username I made was: linuxmf_php1 and gave it all privlagives. What do I do now? Thisis the tutorial I'm using: http://www.tutorialized.com/tutorial/Basic-Forum/13149
  8. Ok. I beleive the user I created has the privagle to "All" I tihnk. Okay, thanks. Ok, I created them now do I export them and upload them? if so, do I have to upload them to a certain folder or jsut the main directory of the forum?
  9. Hi, I need help using phpMyAdmin. I am using a tutorial to create my own forum software written in php & MySQL, a simple forum. I nee dhelp creating these in phpMyAdmin for my forum: [code] The Categories Table: Our id is the primary key and has a max number of 9,999 (4 characters). The Id will auto increment (+1) everytime a new row is inserted into this table. The title and description have a max character length of 255. create table categories(   id int(4) not null auto_increment,   title varchar(255) not null,   description varchar(255) not null,   primary key(id) );  The Forums Table: More complex than the categories table, this has a main id, and cid which will be used to define our 'category id'. Primary key is id. The other columns should be self-explained by now (nothing new introced since the previous table). create table forums(   id int(4) not null auto_increment,   cid int(4) not null,   title varchar(255) not null,   description longtext not null,   last_post_title varchar(255) not null,   last_post_username varchar(32) not null,   topics int(9) not null,   replies int(9) not null,   primary key(id) );  The Topics Table: This next one is longer, but still basic. Take note of the timestamp column. This will be used to define what threads are newest (to show first when being listed). create table topics(   id int(9) not null auto_increment,   timestamp int(20) not null,   fid int(4) not null,   title varchar(255) not null,   post longtext not null,   username varchar(32) not null,   last_post_username varchar(32) not null,   replies int(9) not null,   views int(9) not null,   primary key(id) );  The Replies Table: A much simplified version of the 'topics' table, nothing unordinary. create table replies(   id int(9) not null auto_increment,   tid int(9) not null,   post longtext not null,   username varchar(32) not null,   primary key(id) );  [/code] Can someone here help me do this in phpMyAdmin i created a database in my admin CP and a username & password for that database in my admin CP.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.