PHP - Users Using Fire Fox May Have Issues Going To My Forum.
So i loaded up firefox as im used to working in Chrome and IE and it looks like my forum isnt liking firefox.
Can anyone else report that the banner/picture is not displaying and the table of the forum is squished? http://www.holdenspares.com next question is if this is the case for all users on fire fox, how do i fix it? Similar TutorialsHi Chaps, I'm about to start building a MySQL/PHP forum but would like to know what are the best administration steps to take. Basically it'll be open to members of a site to share info (as like many forums out there), but obviously I don't want anybody to post either harmful content or offensive material. Can someone point me in the right direction, or give me a basic outline of what I have to look out for? Many thanks Hello
I am trying to work out how many regular users I have to my site and how long those users tend to be users..
So, I have a table that logs every time a user visits my site and logs in, it stores the date / time as a unix timestamp and it logs their user id.
I started by getting the id's of any user who logs in more than 5 times in a specified period, but now I want to extend that...
SELECT userID as user, count(userID) as logins FROM login_history where timestamp > UNIX_TIMESTAMP('2014-06-01 00:00:00') and timestamp < UNIX_TIMESTAMP('2014-07-01 00:00:00') group by user having logins > 5; I just discovered that I have a major security flaw with my website. Anyone who logs in to the website can easily access other users information as well as delete and edit other users information just by changing the ID variable in the address bar. I have user ID Session started on these pages but still people can do anything they like with other users information just by editing the address bar. For example if your logged in in the address bar of www.mywebsite.com/delete_mystuff.php?id=5 and change the "5" say to a "9" then you will have access to user#9 information. Every important page that I have has this code: Code: [Select] session_start(); if (!isset($_SESSION['user_id'])) { // Start defining the URL. $url = 'http://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']); // Check for a trailing slash. if ((substr($url, -1) == '/') OR (substr($url, -1) == '\\') ) { $url = substr ($url, 0, -1); // Chop off the slash. } // Add the page. $url .= '/index.php'; ob_end_clean(); // Delete the buffer. header("Location: $url"); exit(); // Quit the script. } else { //Else If Logged In Run The Script if((isset($_GET['id'])) && (is_numeric($_GET['id']))) { $id = (int) $_GET['id']; } elseif ((isset($_POST['id'])) && (is_numeric($_POST['id']))) { $id = (int) $_POST['id']; } else { echo ' No valid ID found, passed in url or form element'; exit(); } What am I doing wrong? Please help if you know how to correct this. Many thanks in advance. Unless i'm mistaken, the part within the IF statement should only occur if $table_res['Field'] is found within $data but instead it pushes to the array no matter what! #Read the file that was just uploaded for use $csvfile = "csv/datafile.csv"; $fh = fopen($csvfile,"r") or die("Could not open rename.csv file !"); #GET ALL THE FIELDS WITHIN THE TABLE STRUCTURE #USE IT TO COMPARE AGAINST THE COLUMNS IN THE CSV FILE #MAP WHICH COLUMN BELONGS TO WHAT FIELD $tbls_sql = "SHOW COLUMNS FROM $tablename"; $tbls_qry = mysql_query($tbls_sql) or die(mysql_error()); $fieldarray = array(); $keyarray = array(); $data = fgetcsv($fh); while($tbls_res = mysql_fetch_assoc($tbls_qry)) { #echo $tbls_res['Field'] . "<BR>"; if($getkey = array_search($tbls_res['Field'],$data)) { array_push($fieldarray,$tbls_res['Field']); array_push($keyarray,$getkey); } else { echo ""; } } This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=310924.0 Today, Amazon announced the "Fire Phone", what are your thoughts?
http://www.businessi...re-phone-2014-6
Hello!
I was assigned to create a simple php game as a part of my grade. I'm not really a php expert and this isnt really working. I copied some of the code from this website, but this isn't really working for me. I don't really know how to solve the problem and connect that two files.
Part 1:
<html> <head> <title>PHP based example Game - Earth & Wind & Fire (aka Paper-Scissors-Rock)</title> </head> <body> <center> <div id="game"> <a href="?item=earth">Earth<br /><img src="images/sand.png" width="135" height="135" alt="Earth"></a><br /><a href="?item=wind">Wind<br /><img src="images/wind.png" width="135" height="135" alt="Wind"></a><br /><a href="?item=fire">Fire<br /><img src="images/fire.png" width="135" height="135" alt="Fire"></a><br /></div> </center> </body> </html>Part 2: <?php function showComponents($items = null) { $pictures = array( "earth" => '<a href="?item=earth">Earth<br /><img src="images/sand.png" width="135" height="135" alt="Earth"></a><br />', "wind" => '<a href="?item=wind">Wind<br /><img src="images/wind.png" width="135" height="135" alt="Wind"></a><br />', "fire" => '<a href="?item=fire">Fire<br /><img src="images/fire.png" width="135" height="135" alt="Fire"></a><br />', ); if ($items == null) : foreach( $pictures as $items => $value ): echo $value; endforeach; else: echo str_replace("?item={$items}", "#", $pictures[$items]); endif; } function game() { if ( isset($_GET['item']) == TRUE ) : $pictures = array('earth','wind','fire'); $playerPic = strtolower($_GET['item']); $computerPic = $pictures[rand(0, 2)]; echo '<div><a href="http://mapswidgets.com/game.php">New game</a></div>'; if (in_array($playerPic, $pictures) == FALSE): echo "Play as either Earth, Wind or Fire."; die; endif; if ( $playerPic == 'fire' && $computerPic == 'wind' OR $playerPic == 'earth' && $computerPic == 'fire' OR $playerPic == 'wind' && $computerPic == 'earth' ): echo '<h2>You Win!</h2>'; endif; if ( $computerPic == 'fire' && $playePic == 'wind' OR $computerPic == 'earth' && $playerPic == 'fire' OR $computerPic == 'wind' && $playerPic == 'earth' ): echo '<h2>Computer wins!</h2>'; endif; if ($playerPic == $computerPic) : echo '<h2>House wins! =)</h2>'; endif; showComponents($playerPic); showComponents($computerPic); else : showComponents(); endif; } ?>Thanks for your time and help! Okay I am making a forum and it is almost finished. The only thing is, I am stuck on how to get the most updated topics to appear at the top of the list. Like on every forum there is a new forum post that you havent visited yet. They are at the top of the list. How would I do that??? I need to figure out how to give this input a name so when i submit it i can get the data from it.
<!doctype html> <html> <head> <meta charset="utf-8"> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/ui-lightness/jquery-ui.css" type="text/css" rel="stylesheet"/> <style> input{font-size:1.3em;} #log{position: absolute; top: 10px; right: 10px;} span{color:blue; text-decoration: underline; cursor: pointer;} </style> </head> <body> <div id="inputs"></div> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" type="text/javascript"></script> <script src="jquery.googleSuggest.js" type="text/javascript"></script> <script> $.each("web".split(" "), function(i, v){ var div = $("<div>").appendTo("#inputs") , input = $("<input>").appendTo(div) , span = $("<label>").text(v).appendTo(div); input.googleSuggest({ service: v }); }); </script> </body> </html> Hello all,
I am working on my own PHP project where I can build myself my own forum just like how this site functions.
I would like to have user accounts and when you log in have a list of bulletin topics that you can choose from and then post your own question or topic and then other users can go to your post and write answers to it. I know there are many forums out there that you can make and set up to use but I would like to have my own so I can customize it any way I want.
Could I get some ideas on where I should start with this. I have been working on a website with a login functionality and I almost have that set up, then my next steps will be making it so users will be able to post topics.
I been doing google research trying to get some tutorials on this but I haven’t found one that is much help. I will be using phpmyadmin database and I plan on writing my sql as mysqli.
Thank you.
Hello everybody, am a bit new here. My question is, if I am on the right place here? I feel like been in the wrong place. Am looking for some forum where I can ask or find about "General questions" I have about PHP sometimes. Am not sure, if I am on the right "Forum" or if this is the "right category" Thank u! Site Name: Forum Pioneer Link to site: http://forumpioneer.com/ (Down Currently) Positions Available: 2 Admin Super and Normal Moderators phpBB Support Team MyBB Support Team IPB Support Team vBulletin Support Team XenForo Support Team Forum Pioneer is a resource site and webmasters central for forum software. I intend for it to be a collection of the best and the most useful modifications that forum owners need. Pm me for more info. We are currently on phpBB, but I intend to migrate to IPB when the forum gets bigger. Im struggling with this pagination part of the replies of the forum it looks to be the final part! Heres the code: Code: [Select] <?php include 'connect.php'; // get value of id that sent from address bar $id=$_GET['id']; $sql="SELECT * FROM topic WHERE id='$id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); // find out how many rows are in the table $sql = "SELECT COUNT(*) FROM reply"; $result = mysql_query($sql) or trigger_error("SQL", E_USER_ERROR); $r = mysql_fetch_row($result); $numrows = $r[0]; // number of rows to show per page $rowsperpage = 10; // find out total pages $totalpages = ceil($numrows / $rowsperpage); // get the current page or set a default if (isset($_GET['currentpage']) && is_numeric($_GET['currentpage'])) { // cast var as int $currentpage = (int) $_GET['currentpage']; } else { // default page num $currentpage = 1; } // end if // if current page is greater than total pages... if ($currentpage > $totalpages) { // set current page to last page $currentpage = $totalpages; } // end if // if current page is less than first page... if ($currentpage < 1) { // set current page to first page $currentpage = 1; } // end if // the offset of the list, based on current page $offset = ($currentpage - 1) * $rowsperpage; ?> <table width='800' border='0' align='center' cellpadding='10'> <tr> <td width='20' height='50' align='center' bgcolor='#990000'><font color='#FFFFFF'><b>ID</b></font></td><td width='200' height='50' align='center' bgcolor='#990000'><font color='#FFFFFF'><b>Username:<br />Date & Time:</b></font></td><td align='center' bgcolor='#990000'><font color='#FFFFFF'><b>Topic & Message:</b></font></td> </tr> <tr> <td height='50' align='center' valign='top' bgcolor='#AAAAAA'></td> <td height='50' align='center' valign='top' bgcolor='#AAAAAA'><b><? echo $rows['username']; ?></b><br /><? echo $rows['date']; ?><br /><? echo $rows['time']; ?></td> <td height='50' align='center' bgcolor='#AAAAAA'><b><a href="viewtopic.php?id=<? echo $rows['id']; ?>"><? echo $rows['topic']; ?></a></b></td> </tr> <tr> <td height='50' align='center' bgcolor='#AAAAAA' colspan='3'><? echo $rows['detail']; ?></td> </tr> <tr> <td></td> </tr> <?php $sql2 = "SELECT * FROM reply WHERE reply_id='$id' LIMIT $offset, $rowsperpage"; $result2 = mysql_query($sql2) or trigger_error("SQL", E_USER_ERROR); while($rows=mysql_fetch_array($result2)){ ?> <tr> <td height='50' align='center' valign='top' bgcolor='#AAAAAA'><b><? echo $rows['a_id']; ?></b></td> <td height='50' align='center' valign='top' bgcolor='#AAAAAA'><b><? echo $rows['a_username']; ?></b><br /><? echo $rows['a_date']; ?><br /><? echo $rows['a_time']; ?></td> <td height='50' align='center' bgcolor='#AAAAAA'><? echo $rows['a_reply']; ?></td> </tr> <? } ?> </table> <br /> <BR> <table width="400" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="form" method="post" action="addreply.php"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td valign="top"><strong>Reply</strong></td> <td valign="top">:</td> <td><textarea name="a_reply" cols="45" rows="3"></textarea></td> </tr> <tr> <td> </td> <td><input name="id" type="hidden" value="<? echo $id; ?>"></td> <td><input type="submit" name="Submit" value="Submit"> <input type="reset" name="Reset" value="Reset"></td> </tr> </table> </td> </form> </tr> </table> <?php /****** build the pagination links ******/ // range of num links to show $range = 3; // if not on page 1, don't show back links if ($currentpage > 1) { // show << link to go back to page 1 echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=1'>First</a> "; // get previous page num $prevpage = $currentpage - 1; echo " - "; // show < link to go back to 1 page echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$prevpage'>Previous</a> "; } // end if // loop to show links to range of pages around current page for ($x = ($currentpage - $range); $x < (($currentpage + $range) + 1); $x++) { // if it's a valid page number... if (($x > 0) && ($x <= $totalpages)) { // if we're on current page... if ($x == $currentpage) { // 'highlight' it but don't make a link echo " [<b>$x</b>] "; // if not current page... } else { // make it a link echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$x'>$x</a> "; } // end else } // end if } // end for // if not on last page, show forward and last page links if ($currentpage != $totalpages) { // get next page $nextpage = $currentpage + 1; // echo forward link for next page echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$nextpage'>Next</a> "; echo " - "; // echo forward link for lastpage echo " <a href='{$_SERVER['PHP_SELF']}?currentpage=$totalpages'>Last</a> "; } // end if /****** end build pagination links ******/ ?> When I click next page or any link it goes to the table but blank page. I have also added '?id=$id' before ?currentpage on the link but this just doubles up the ?currentpage on the address page. Please help im really struggling! Thanks Hello! I can't manage to get my forum to work. When I want a new topic to be made I got some code I will show in a second. But I just keep getting my own error message that just shows me something is wrong ... please help me figure it out. Hey! So, I don't know if this is the current section, couldn't really decide on what section/board to post it, so ..
I've got a code that I got from a friend of mine (it was a gaming website (a game server), but he shut it down, I asked for some scripts, he sent me the whole site ..). I got all other scripts correctly, but I do not know how to get this Last Forum Posts to work (IP.Board). I've got the SEO set up as it should and everything, doesn't work.
When I use this
<?php $_handlerForum = new mysql("Forum","localhost","*********_fqipb2","*********_fqipb2","password"); $topics = $_handlerForum->fetch("SELECT `tid`,`title`,`last_post`,`title_seo`,`last_poster_name` FROM `topics` ORDER BY `last_post` DESC LIMIT 0,3;",array()); $content = ""; foreach($topics as $topic) { $content .= "<a href='http://website.com/forum/index.php?/topic/".$topic['tid']."-".$topic['title_seo']."' target='_blank'>".$topic['title']."</a><br /> <small class='dim'>".$topic['last_poster_name']." - ".date("H:i F d, Y",$topic['last_post'])."</small><hr style='margin: 5px 0px;' />"; } return $content; return "Under Construction"; ?>I get this error Fatal error: Class 'mysql' not found in /home/***/***/***/public_html/extra/forum.php on line 2Thought that the problem was "new mysql" (on line 2), so I put in mysql_connect, still get an error. Can anyone help? Lets say I have a simple table for Categories; fid forum desc cat 1 General Forum desc here 1 2 Help Forum desc here 2 3 Console Forum desc here 3 Hello! I think I need some creative juice to start my flow and am thankful for any suggestions. I am looking into some advice on how to code in "Category" wise. Lets say if I have forums like this; General Forum Quote General Talk about anything in general to NewbWorld. Suggestions Have any ideas to give to NewbWorld? Anything Goes Talk about anything you want! Help Forum Quote HTML Help If you are having problems with HTML coding post here! PHP Help If you are having problems with PHP coding post here! Instead of me manually coding each Category (General Forum, Help Forum, Console Forum, etc)... I want to be able to have the following coded like so; List Category ---Forum Sub Category ---Forum Sub Category ---Forum Sub Category List Category 2 ---Forum Sub Category ---Forum Sub Category ---Forum Sub Category Right now; I've been coding the "List Category" manually to show "Sub Forums". I would like to know how to do this without manual anymore. I would love to start coding an admin/moderator panel soon. Any help is much appreciated and thankyou for your time! here is my code which is supposed to return all forums from the database and then display them in their respective categories. however it only shows one of the forums and not all of them. Anyone know why? function display_forum_list($crumbs) { global $link, $template, $settings, $lang, $config, $user; $template->replace( array( '{CRUMBS}' => display_crumbs($crumbs) ), 'index_page'); $query = $link->query("SELECT * FROM ".TBL_PREFIX."forums ORDER BY f_lid ASC"); $result = $query->fetchAll(); foreach($result as $key => $val) { if($result[$key]['f_pid'] == 0) { $cat_name = $result[$key]['f_name']; } else { $forum_name = $result[$key]['f_name']; } $forum_desc = $result[$key]['f_description']; } $template->replace( array( '{CATEGORY}' => $cat_name, '{F_ICON}' => '', '{F_NAME}' => $forum_name, '{F_DESC}' => $forum_desc, '{SITE_ROOT}' => $config['asf_root'] ), 'forum_list'); } Hello! My problem is that in my forum I want to display the picutre of their user and if they do not have a picture I want to show the standard one. I got all of this working on another part of the page but for some reason I can only get it to display the standard picture and not their custom picture... The code looks like this: Code: [Select] <?php // Now query any responses out of the database and place in a dynamic list $sqll = mysql_query("SELECT id FROM myMembers"); while($row = mysql_fetch_array($sqll)){ $id = $row["id"]; $check_pic = "..//members/$id/image01.jpg"; $default_pic = "..//members/0/image01.jpg"; if (file_exists($check_pic)) { $user_pic = "<img src=\"$check_pic\" align=\"left\" width=\"80px\" border=\"0\" />"; // forces picture to be 120px wide and no more } else { $user_pic = "<img src=\"$default_pic\" align=\"left\" width=\"80px\" border=\"0\" />"; // forces default picture to be 120px wide and no more } } $all_responses = ""; $sql = mysql_query("SELECT * FROM forum_posts WHERE otid='$thread_id' AND type='b'"); $numRows = mysql_num_rows($sql); if ($numRows < 1) { $all_responses = '<div id="none_yet_div">No respond has been posted yet.</div>'; } else { while($row = mysql_fetch_array($sql)){ $reply_author = $row["post_author"]; $reply_author_id = $row["post_author_id"]; $date_n_time = $row["date_time"]; $convertedTime = ($myAgoObject -> convert_datetime($date_n_time)); $whenReply = ($myAgoObject -> makeAgo($convertedTime)); $reply_body = $row["post_body"]; $all_responses .= '<div class="response_top_div"> ' . $thread_title . ' | ' . $whenReply . ' <a href="../profile.php?id=' . $reply_author_id . '">' . $reply_author . '</a> said:</div> <div class="response_div" style="padding-left:20px; vertical-align:text-top;">' . $user_pic . ' <div style="padding-left:117px;"> ' . $reply_body . '</div></div>'; } } ?> Please help me if you can! Thank you! Hello im using mybb forum, and i have another webpage what i want to access with forum username and password. Dont know how to make it work.
Is it just me or is anyone else having problems with the site? When I make a reply to a post and submit it, my post is added but it also appears as an edit window still below my just-posted post. Also - when I try and edit my post the edit window opens up but the text of my post flashes by and does not show. If I re-type the entire post with my edits and save it, the edits do not appear. This has been happening for 3-4 days now. Edited by ginerjm, 30 December 2014 - 01:33 PM. |