Jump to content

Andy82

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Andy82's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey, Surely if you have more memory available than what you are using then everything should be fine. Andy
  2. Hey, Your PHP tags appear to be incorrect. There is an error on line 83 and another on 94. The tags are opened on line 80 and 92 and not closed before the next opening ones. Andy
  3. Hey, Im a newbie too. The PHP Manual show here http://uk2.php.net/include/ in Example 3 that you should be using single quotes. // Works. include 'http://www.example.com/file.php?foo=1&bar=2'; Andy
  4. Hey, I am trying to build a function for lastest entries. I have... function new_stuff() { global $prefix, $options; $new_stuff = get_cache('new_stuff'); if (!$new_stuff) { $new_stuff_query = mysql_query("SELECT title, contentid, FROM ". $prefix ."content WHERE status = '1' ORDER BY dateadded DESC, contentid DESC LIMIT ". $options['max_new_stuff']) or die (mysql_error()); $counter = '0'; $new_stuff = array(); while ($new_stuff_row = mysql_fetch_assoc($new_stuff_query_query)) { $counter++; $new_stuff[] = array ( 'id' => $new_stuff_row['contentid'], 'title' => $new_stuff_row['title'], 'counter' => $counter ); } // Write cache file write_cache('new_stuff', $new_stuff); } return $new_stuff; } This works fine, the problem I am having is with content sections. I have a section id in my content table e.g Content table title contentid sectionid Sections sectionid section How do I display the sectionid in the content table to display as the section text in the sections table? Thank you for any help.
  5. EDIT: Quoted the wrong person. Will change it after some sleep ! @fenway: How can I learn making my first PHP CMS without making something that has been made? This is something that will be made only for me to learn how stuff works .
  6. I know there are premade scripts out that do this. The only reason I wanted to use this as a basis for my first attempt is it is something that I am interested in. It was either this or something gaming related like a cheat site...but there are even more of those.
  7. Hey, After messing around with PHP and MySQL for a little while I am trying to make my first CMS. It is going to be used for media i.e. Games, Videos, Jokes, Images and maybe more. I want it so I can select the last [X] amount of Media (Games, Videos, Jokes, and Images) added in the last [X] amount of time and order them based e.g. on a timestamp. The thing that I am concerned about is if I have say 5000 rows in each, I will need to select all 20,000 results to get only a few results. How should the tables be structured? Should I have 1 for everything and then define the type in a field? or Should I have a separate each into it own table e.g. Games, Videos etc? Any help would be greatly appreciated. Andy
  8. It looks like you have a mismatch in {} of the IF ELSE statement.
  9. Thank you very much, I really appreciated it
  10. Hey, I am learning PHP and am having a problem with using microtime. I am trying to make a page load timer and the tutorials I have found use microtime. The code I have come up with is: <?php error_reporting(0); $page_load_start = microtime(); //the include files are here.... $page_load_end = microtime(); $page_load_time = $page_load_end - $page_load_start; print("<!-- Time: " . $page_load_time . "-->"); ?> This produces a result that is about 10 digits long e.g. 1.230000000001 How would I make this number down to 1.23 seconds? I have looked at trim() and substr() but no luck. Thank you for any help Andy
  11. Hey, I'm still trying to get this to work (without any luck ) Could someone please shed so light on this I have tried checking if the files exist, if not show the custom error page, again without luck. Basically I want it so if the folder or file requested doesn't exists it shows the (modules/error/404.php). Thank you Andy
  12. Hey, Thank you for replying. I know the folder doesn’t exist…but instead of showing the error I want it to show my error page (modules/error/404.php). I have read that default 404 page can be replaced using .htaccess but as the site is set up as header, content (the code from my first post is in here.) and footer files included in the index file I thought I needed to do it this way. Andy
  13. Hey, Can someone please help with the code below. I am learning PHP and making a site solely for the purpose of learning but want a means of navigating from page to page. As a newbie I don’t really know if I am going in the right direction, is this the right way to do things? What I have so far is below. What I need the code to do... Default to modules/news/index.php if no variables are set. If only a folder is set show the index.php file of that folder. If only the file is set show modules/filename.php If the folder or file is not found then show an error page. Current it appears to work correctly, apart from showing the error page and just shows the PHP warnings… Warning: main(modules/xxxxx/xxxx.php) [function.main]: failed to open stream: No such file or directory in /xxxxx/xxxxx/xxxxx/xxxxx on line 2 <?php $folder = $_GET['go']; $file = $_GET['to']; if(!isset($folder) && (!isset($file))) { include"modules/news/index.php"; } elseif(isset($folder) && isset($file)) { include "modules/".$folder."/".$file.".php"; } elseif (!isset($folder) && isset($file)) { include "modules/".$file.".php"; } elseif (!isset($file) && isset($folder)) { include "modules/".$folder."/index.php"; } else { include "modules/error/404.php"; } ?> Thank you for any help you can provide. Andy
×
×
  • 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.