PHP - How To Create Dynamic Pages For A News Content Website ?
I got a question regarding a news website content that i want to make ! my question is how do i call my contents without using a lot of page? i explain let's say i got 10 news how do i put this 10 news in different pages without using 10 pages ? ex: you can see some links having a number like this http://bbc.uk/news/murder_case-12 then the next page got http://bbc.uk/news/finance-13 the title and the number id change but the page news doesnt change thanks for your answer. Similar TutorialsHey everyone, I'm new to web programming so I thought I would join a active community to help me out. Anyhow, I'm making a game portal and I want the users games to have a url like so... games/username/gamename. From what I understand I could get this structure by simply using data from my login session(username) and using my upload form(gamename) and mkdir. Then I would need to have an index page inside every gamename folder? How would I add the index pages inside such folders. This way seems pretty inefficient to do considering I could pull the games dynamically in a single php file. Is there a way I can make my url look nice and still use one file to handle the embedding of the games, comments etc. Thanks What's the best way to create a news feed? How would you guys do it? Would you have to have a time stamp stored for when each action occurred? How can I go about making dynamic pages? eg. user types "phpfreaks.com/index.php?page=name" Hi, I hope someone can help. I currently have a page that includes the main page after login, however I am looking into changing this so that when a user logs in they get 3/4 linked images that, when clicked dynamically load/include the page based on the select i.e. user selects the image laptop, that has a hyperlink, it loads the laptop page. If anyone has any ideas or suggestion,i'd appreciate it. Hi, I will start off trying to explain what I am trying to make the best I can. What I want to create is a script that gets the gold value from this website: http://www.lbma.org.uk/pages/index.cfm?page_id=46&title=current_statistics and then save it to a variable which I will use to calculate values of different gold karats. Here is the content in bold I need on the website I linked: Quote LONDON GOLD FIXING USD GBP EUR AM 1588.00 1005.127 1251.083 PM 1589.50 1004.741 1249.803 So what help do I need? Well, I don't expect you to figure out the calculating part for me but some help how to get that content pointed out above and save it to a variable is what I would appreciate getting some help with. I don't know much PHP, only some and I have been trying to figure this out for a day now without any success. I suppose php get contents and/or curl should be used here but I don't know how really. I would very much appreciate the help I can get on this. Thank you! Hello, I'm having problems with creating send mail form, what it does it's just reload on "submit" click... I'm working on this for the last hour and still can't figure out what I'm missing. I don't get any error not even confirmation of successful or unsuccessful send... Here's the code <html> <body> <?php echo'<form enctype="multipart/form-data" method="post">'; echo'<form method="post" action="sendmail">'; echo'<input type = "text" value ="'.$email_to.'" name = "user_mail">'; echo '<input type="submit" name="Submit" value="Submit">'; echo '</form>'; ?> <?php elseif ($_GET['send']=='sendmail'):?> <?php $fileatt = "testfile.pdf"; // Path to the file $fileatt_type = "application/pdf"; // File Type $fileatt_name = "testfile.pdf"; // Filename that will be used for the file as the attachment $email_to = $user_mail; //send to $email_from = "dont@have.it"; // Who the email is from $email_subject = "Your attached file"; // The Subject of the email $email_message = "Thanks for visiting mysite.com! Here is your free file.<br>"; $email_message .= "Thanks for visiting.<br>"; // Message that the email has in it $email_to = $_POST['email']; // Who the email is to $headers = "From: ".$email_from; $file = fopen($fileatt,'rb'); $data = fread($file,filesize($fileatt)); fclose($file); $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $email_message .= "Here's your file .\n\n" . "--{$mime_boundary}\n" . "Content-Type:text/html; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $email_message .= "\n\n"; $data = chunk_split(base64_encode($data)); $email_message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatt_type};\n" . " name=\"{$fileatt_name}\"\n" . //"Content-Disposition: attachment;\n" . //" filename=\"{$fileatt_name}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data .= "\n\n" . "--{$mime_boundary}--\n"; $ok = @mail($email_to, $email_subject, $email_message, $headers); if($ok) { echo "<font face=verdana size=2><center>Mail was sent.</center>"; } else { die("Sorry but the email could not be sent. Please go back and try again!"); } ?> <?php endif;?> </html> </body> I have created script that puts user information in MySQL database table called "Users" when they register. Now i want to create page to show all the accounts in that table and some custom fields they filled in as well. Like Name, Age, Sex. My table is 1Name 2Age 3Sex 4Email John 22 M john@gmail.com Kate 34 F kate@yahoo.com etc... I trying to show all users at once, so far i pulled info one by one successefully, and also queried that entire table trough array, but its creates huge list on one page i dont like this, i need to separate it to 10 accounts per page. How can i do that? I also like page 1, page2, page3 be linkable from homepage is there way to make them have static page like http://site.com/users.php?pages=2. Please advise. Hello, I ran into new problem, I'm trying to figure this out for last two days, in total of 12 hours and you guys are my last hope. I've got 4 files that needs to be "connect" index.php <- contains one switch statement Here's part of it Code: [Select] $step = (isset($_GET['action'])) ? $step = $_GET['action'] : $step = "1"; switch($step) { //index case "1": include("admin/index.php"); break; second file is located in admin/index.php <- contains navigation links, pure html Here's part of it Code: [Select] <a href="?action=1">Home</a><br /> This is all working fine with no problems, which starts here I've got script for categories and subcategories which contains links and buttons Code: [Select] <input type="button" name="Button" value="Remove" onClick="location='?action=delete&id=<?=$c["id"]?>'"> [<a href="?action=delete&id=<?=$c["id"]?>">Remove</a> In first index.php located outside /admin/ folder, where switch statement is I have the following code case "delete": require("admin/categories.class.php"); $categories->delete($_GET["id"]); echo '<script>alert("Removed!"); location="admin/class_categories_test.php"; </script>'; break; and when I click on "Remove" I get the following error Quote Fatal error: Call to a member function delete() on a non-object in index.php As you may notice all functions are stored in admin/categories.class.php that's why I've require("admin/categories.class.php"); in switch statement. Regards Hi, i coded a very simple forum "website" with registration, login, and a place where everyone posts comments. I wanted to make some sort of profile page for each user so they would each have their own URL too (e.i. test/barney or test/simpsons). each of these pages would have different content, depending on what barney or simpsons puts on that page. i've been looking everywhere trying to find documentation but i don't think i know how to search it correctly. I checked a lot of mod_rewrite documentation but i don't understand if i'm suppose to call a php function to create a profile page or something. Any guidance would be greatly appreciated Thanks! Great conversation, wrong board. This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=357967.0 Hi, I don't know why it outputs" You are now registered BUT the user name and password don't show up in the database! I want to encrypt the passwords so maybe that is problem, I don't know, please read scripts below. here is register.php: ============== Code: [Select] <html> <head></head> <body> <form method="post" action="" > <p>Create a username <input type="text" name="newUsername"/> </p> <p>Create a password <input type="password" name= "newPassword" /> </p> <p> <input type="submit" value="Make account now" name="makeAccountSubmit" /> </p> </form> <?php if(array_key_exists("makeAccountSubmit",$_POST) && !empty($_POST["newUsername"]) && !empty($_POST["newPassword"]) ) { //IF username doesn't exist, then store new user login info to db dummydpevx mysql_connect("localhost","root"); mysql_select_db("someDB"); $newUserName=$_POST["newUsername"]; $newPassword=crypt($_POST["newPassword"]); $usernameQuery=mysql_query("SELECT userName FROM users WHERE userName='$newUserName'"); if(mysql_num_rows($usernameQuery)==0) { $makeNewAccountQuery=mysql_query("INSERT INTO users userName,userPassword VALUES('$newUserName','$newPassword')"); print "You are now registered, <a href='login.php'>proceed to login</a>"; } if(mysql_num_rows($usernameQuery)==1) print "Username taken. Please make another one. <br />"; } here is login.php: ============ Code: [Select] <html> <head></head> <body> <form method="post" action=""> <label>Username:</label> <input type="text" name="username" /> <br /> <label>Password:</label> <input type="password" name="password" /> <p> <input type="submit" value="Login" name="Login" /> <input type="reset" value="Reset" name="Reset" /> </p> </form> <?php if(array_key_exists("Login",$_POST) && !empty($_POST["username"]) && !empty($_POST["password"])) { $attemptedUsername=$_POST["username"]; $attemptedPassword=$_POST["password"]; mysql_connect("localhost","root"); mysql_select_db("someDB"); $getLoginInfoQuery=mysql_query("SELECT userName,userPassword FROM users WHERE userName=$attemptedUsername AND userPassword=$attemptedPassword"); $getLoginInfo=mysql_fetch_assoc($getLoginInfoQuery); $getUsername=$getLoginInfo["userName"]; $getPassword=crypt($getLoginInfo["userPassword"]); if(crypt($attemptedPassword,$getPassword)==$getPassword) { session_start();//NB: Start session BEFORE doing any session stuff! $_SESSION["isAuthenticated"]="userAuthenticated"; header("Location: xmlShredderIndex.php"); exit; } else print "Please register!"; } Also, if any has time, please see my other post, it is straightforward instructions to see if you get same error as me, thanks. http://www.phpfreaks.com/forums/index.php?topic=347639.msg1640652#msg1640652 Any help much appreciated! i'm trying to achive this results layout: example: catagory comment comment comment catagory catagory catagory comment what is being pulled now is if their is 2 comments two 1 catagory then 2 catagorys are being returned with the same id. what i want is to return one cataogry with many comments. thanks in advance for your help. Code: [Select] <?php require_once('Connections/Del_Comments.php'); ?> <?php $all_ids = array(); $str_ids = ""; // first parent query $maxRows_sourceType = 10; $pageNum_sourceType = 0; if (isset($_GET['pageNum_sourceType'])) { $pageNum_sourceType = $_GET['pageNum_sourceType']; } $startRow_sourceType = $pageNum_sourceType * $maxRows_sourceType; mysql_select_db($database_Del_Comments, $Del_Comments); $query_sourceType = "SELECT a.Id, a.Type, a.Dates, a.UIdFk, b.Id as Did, b.comment, b.dates as Day, b.sfk as Sfk , c.sfk as sfk1, d.Memo as memo FROM asstatusupdate as a left join asstatusdata as b on a.id = b.sfk left join asmanystatusupdate as c on b.sfk = c.sfk left join ascomments as d on d.id = c.cfk where a.uidfk='1' order by Dates asc"; $query_limit_sourceType = sprintf("%s LIMIT %d, %d", $query_sourceType, $startRow_sourceType, $maxRows_sourceType); $sourceType = mysql_query($query_limit_sourceType, $Del_Comments) or die(mysql_error()); $row_sourceType = mysql_fetch_assoc($sourceType); if (isset($_GET['totalRows_sourceType'])) { $totalRows_sourceType = $_GET['totalRows_sourceType']; } else { $all_sourceType = mysql_query($query_sourceType); $totalRows_sourceType = mysql_num_rows($all_sourceType); } $totalPages_sourceType = ceil($totalRows_sourceType/$maxRows_sourceType)-1; // add the array while ($row_source = mysql_fetch_assoc($sourceType)) { $all_ids[] = $row_source['Sfk']; $str_ids .= $row_source['Sfk'].','; } // remove the array $str_ids = (substr($str_ids,-1) == ',') ? substr($str_ids, 0, -1) : $str_ids; echo $str_ids; //echo $all_ids; //second child query $maxRows_sourceComments = 10; $pageNum_sourceComments = 0; if (isset($_GET['pageNum_sourceComments'])) { $pageNum_sourceComments = $_GET['pageNum_sourceComments']; } $startRow_sourceComments = $pageNum_sourceComments * $maxRows_sourceComments; mysql_select_db($database_Del_Comments, $Del_Comments); $query_sourceComments = "SELECT c.sfk as sfk1, d.Memo as memo FROM asmanystatusupdate as c left join ascomments as d on d.id = c.cfk where c.uidfk0='1' and c.sfk in ($str_ids)"; $query_limit_sourceComments = sprintf("%s LIMIT %d, %d", $query_sourceComments, $startRow_sourceComments, $maxRows_sourceComments); $sourceComments = mysql_query($query_limit_sourceComments, $Del_Comments) or die(mysql_error()); $row_sourceComments = mysql_fetch_assoc($sourceComments); if (isset($_GET['totalRows_sourceComments'])) { $totalRows_sourceComments = $_GET['totalRows_sourceComments']; } else { $all_sourceComments = mysql_query($query_sourceComments); $totalRows_sourceComments = mysql_num_rows($all_sourceComments); } $totalPages_sourceComments = ceil($totalRows_sourceComments/$maxRows_sourceComments)-1; $resultComments = @mysql_query($query_sourceComments, $Del_Comments); $numComments = @mysql_num_rows($resultComments); $result = @mysql_query($query_sourceType, $Del_Comments); $num = @mysql_num_rows($result); // column count for parent $thumbcols = 1; // column count for parent query $thumbrows = 1+ round($num / $thumbcols); // column count for child query $thumbrowsComments = 1+ round($numComments/$thumbcols); // header print '<br />'; print '<table align="center" width="500" border="3" cellpadding="0" cellspacing="0">'; if (!empty($num)) { print '<tr><td colspan="3" align="center"><strong>Returned Num of Record Sets: ' .$num. ' and comments count' .$numComments. '</strong></td></tr>'; } // table layout for parent query function display_table() { // global variables global $num, $result, $thumbrows, $thumbcols, $resultComments, $numComments, $thumbrowsComments ; // row count for parent for ($r=1; $r<=$thumbrows; $r++) { // print table row print '<tr>'; //format the columns for ($c=1; $c<=$thumbcols; $c++) { print '<td align="center" valign="top">'; $row = @mysql_fetch_array($result); $row1 = @mysql_fetch_array($resultComments); $Id = $row['Id']; $Type = $row['Type']; $Dates = $row['Dates']; $Comment = $row['Comment']; $Sfk1 = $row['sfk1']; $Memo = $row['memo']; // test if not empty show record sets if (!empty($Id)) { // print output from parent query // grab type dates comment and format for there column echo '<td valign="top" align="center">'; echo "$Type"; echo ' '; echo "$Dates"; echo '<br />';echo '<br />';echo '<br />'; echo "$Comment"; echo '</td>'; echo '<td>'; echo "$Id"; echo '</td>'; echo '<td>'; echo "$str_ids"; echo '</td>'; echo '<tr>'; echo '<td>'; echo "$Sfk1"; echo '</td>'; echo '<td>'; echo "$Memo"; echo '</td>'; echo '</tr>'; } // closing the $id loop else { print ' '; } print '</td>'; //closing the table data } //closing the rows print '</tr>'; } // closing the outter loop //} //closing fk id loop print '</td>'; //closing the table data } //closing the rows print '</tr>'; //} // closing the main loop // call the main table display_table() ; print '</table>'; ?> <?php var_dump(substr('a', 1)); // bool(false) ?> I have a form that inserts information into a mysql, the only prolem is I need to add different surrounding html to the information when entering it into the database depending what the value is...(essentially I want to store font color around different levels) How would I define the same variable with different information depending on the value? The information is called using: if ($_SERVER['REQUEST_METHOD'] == 'POST') { $editLEVEL=$_POST['level']; I want it so if 'Level1' is the posted value then $editLEVEL would be '<color=1>$editLEVEL</color>' but if 'Level2' is the posted value the $editLEVEL would be '<color=2>$editLEVEL</color>' If you dont understand just let me know I'll try explain best I can. I've searched and found numerous examples for creating dynamic forms using PHP and MySQL; however, each seems to be different and I have been unsuccessful with all of them. What I get is an empty pulldown menu instead of the contents from the MySQL table. I've worked this till I'm blue in the face and am now turning to the forums for help. I'm developing/testing code in NetBeans 8.0.2. Here is my code (name of file is 'domains.php': <body> <form method="post" action=""> <select id="domain" name="domain"> <?php // define connection variables $DBServer = "localhost"; // server name or IP address $DBUser = "xxxxxxxxx"; $DBPass = "xxxxxxxxx"; $DBName = "country"; $DBPort = "3306"; // I include the port because I have two instances of MySQL - the other is 3309 // create a connection to mysql $conn = mysqli_connect ($DBServer, $DBUser, $DBPass, $DBName, $DBPort); // check to see if a connection was made and, if yes, proceed if (mysqli_connect_errno()) { // connection failed echo "Database connection failed: " . mysqli_connect_error(); } // the domain query to get all domain names $domainQuery = "select domains from domains_subdomains_cop"; // run the query -- this works elsewhere to display the contents of a table $resultD = mysqli_query($conn, $domainQuery) or die ("Query to get data from domain failed: " . mysql_error()); // with the exception of a pulldown menu, the while loop works well to display all records, etc. // I've seen examples with MYSQLI_ASSOC and without and I've tried both without success - I use it because I // haven't had any issues elsewhere in my program while ($row=mysql_fetch_array($resultD, MYSQLI_ASSOC)) { $domainName=$row[DOMAINS]; // DOMAINS is the table attribute I'm trying to pull echo "<option> $domainName // I accidentely put a ';' here once and that did show up in the pulldown menu </option>"; } ?> </select> </form> </body> In advance, thank you for any help/insight you can provide!!! Nick. example:
pulling a 5x5 array of data from a database
time differences:
components (unbuilt):13400101661682
elements (built):13817119598389
How I'm stealing the elements from the PHP code:
ob_start();
...
ob_end_clean();
Hi guyz, I am looking to create a dymanic comment box for my website where already logged in users can comment on webpages. It is quite a challenge getting to dynamically display only the comments a particular user posted on a web page. What I mean is I would like to be able to click on a page, see only the comments logged users posted on that page, and then post my own comment on that page. At the moment I created a comment box for my webpages but the issue is my posted comments on one particular page is displaying on all web pages with is comment system..This is the problem and it is very difficult to find helpful material hopefully you guyz can come to the rescue. Please guys any help or suggestions are more than welcome. Thanks Kdiamonds I'm am somewhat new to PHP and am trying to set up a website for my cousin's wedding. Her idea is to have the guests sign in with a user/pass that she provides, and once they sign in, they will be taken to a page that has their name on it (i.e. "Mr. and Mrs. So and So, you are invited...). I have come to the conclusion that I will need to make an image for each guest's name (she wants to use a font for their names that nobody will have on their computer) so what I need to know is: How do I link each user name to their own personalized webpage, where the image of their name on the next page will change based on what username is entered? The php code I have right now is this (i'm sorry it's so long, I just don't want to leave anything out that might be important): $LOGIN_INFORMATION = array( 'steve' => 'password', 'rick' => 'password', 'tom'=> 'password' ); // request login? true - show login and password boxes, false - password box only define('USE_USERNAME', true); // User will be redirected to this page after logout define('LOGOUT_URL', 'http://www.example.com/'); // time out after NN minutes of inactivity. Set to 0 to not timeout define('TIMEOUT_MINUTES', 0); // This parameter is only useful when TIMEOUT_MINUTES is not zero // true - timeout time from last activity, false - timeout time from login define('TIMEOUT_CHECK_ACTIVITY', true); ################################################################## # SETTINGS END ################################################################## /////////////////////////////////////////////////////// // do not change code below /////////////////////////////////////////////////////// // show usage example if(isset($_GET['help'])) { die('Include following code into every page you would like to protect, at the very beginning (first line):<br><?php include("' . str_replace('\\','\\\\',__FILE__) . '"); ?>'); } // timeout in seconds $timeout = (TIMEOUT_MINUTES == 0 ? 0 : time() + TIMEOUT_MINUTES * 60); // logout? if(isset($_GET['logout'])) { setcookie("verify", '', $timeout, '/'); // clear password; header('Location: ' . LOGOUT_URL); exit(); } if(!function_exists('showLoginPasswordProtect')) { // show login form function showLoginPasswordProtect($error_msg) { ?> <html> <head> <title>Please enter password to access this page</title> <META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE"> <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <style type="text/css"> body,td,th { font-family: Verdana, Geneva, sans-serif; font-size: 10px; color: #666; } body { background-color: #FFFFFB; } </style> </head> <body> <div align="center"> <style> input { border: 1px solid black; } </style> <div style="width:600px; margin-left:auto; margin-right:auto; text-align:center"> <form method="post"> <h4>Please sign in using the information provided on the invitation</h4> <font color="red"><?php echo $error_msg; ?></font><br /> <?php if (USE_USERNAME) echo 'Login:<br /><input type="input" name="access_login" /><br />Password:<br />'; ?> <input type="password" name="access_password" /><p></p><input type="submit" name="Submit" value="Submit" /> </form> <br /> <a style="font-size:9px; color: #B0B0B0; font-family: Verdana, Arial;" href="http://www.zubrag.com/scripts/password-protect.php" title="Download Password Protector">Powered by Password Protect</a> </div> </body> </html> <?php // stop at this point die(); } } // user provided password if (isset($_POST['access_password'])) { $login = isset($_POST['access_login']) ? $_POST['access_login'] : ''; $pass = $_POST['access_password']; if (!USE_USERNAME && !in_array($pass, $LOGIN_INFORMATION) || (USE_USERNAME && ( !array_key_exists($login, $LOGIN_INFORMATION) || $LOGIN_INFORMATION[$login] != $pass ) ) ) { showLoginPasswordProtect("Incorrect password."); } else { // set cookie if password was validated setcookie("verify", md5($login.'%'.$pass), $timeout, '/'); // Some programs (like Form1 Bilder) check $_POST array to see if parameters passed // So need to clear password protector variables unset($_POST['access_login']); unset($_POST['access_password']); unset($_POST['Submit']); } } else { // check if password cookie is set if (!isset($_COOKIE['verify'])) { showLoginPasswordProtect(""); } // check if cookie is good $found = false; foreach($LOGIN_INFORMATION as $key=>$val) { $lp = (USE_USERNAME ? $key : '') .'%'.$val; if ($_COOKIE['verify'] == md5($lp)) { $found = true; // prolong timeout if (TIMEOUT_CHECK_ACTIVITY) { setcookie("verify", md5($lp), $timeout, '/'); } break; } } if (!$found) { showLoginPasswordProtect(""); } } ?> ************************************************************** THANK YOU SO MUCH for any help!! Sam Hi all, here's my code: Code: [Select] <?php foreach ($_SESSION['topping'] as $value) { echo "<tr><td width='30%'>Topping</td><td width='50%'>$value</td><td width='20%'><select name='notopping'>"; foreach ($_SESSION['cupcake'] as $number) { '<option name="notoppings[]" value="'.$number.'">".$number."</option>'; } echo "</select></td></tr>"; } ?> $_SESSION['cupcake'] is a value from either 6, 12, 24 or 36. What I want to do is put them into a drop down box (second foreach) as the value and the displayed value - counting up from 1 (so 1,2,3,4,5,6 or up to 12,24 etc). Also by creating this as an array, does this mean than for each topping (say Vanilla and Chocolate) the value dynamically created can be used on the next page by using $_POST['notoppings'] to display each type (two different numbers - one for Vanilla and one for Chocolate). Does that make sense? Thanks! Jason Hi Everyone, Please excuse my lack of tech. terminology. I'm in the learning stages of php/myslq Do you know how both the below pages are very similiar. The only thing that's different is the actual location(s). My question is, is the same code being used for all of these template pages? If so, how does the code know differentiate between different states/cities/? Does each state or even city have a different template? <<--- Thinking out loud here, I don't believe so because that would defeat the purpose of php/mysql. What do you think? http://cars.oodle.com/regions/illinois/ http://cars.oodle.com/regions/indiana/ >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> http://cars.oodle.com/regions/illinois/ <<--- Assuming this code is being used on the "state template" how does the php/mysql code on this page know how to show data from the Bloomington area of Illinois? (assuming it's not custom code for the above page) http://cars.oodle.com/used-cars/bloomington-il-area/ <<--- Assuming this code is being used on the "cars template" how does the php/mysql code on this page know how to show data from the Bloomington area of Illinois? (assuming it's not custom code for the above page) Thanks everyone! Hi, if I want to sepcify certain elements to a category: <?php if (category_id == 3) { ?>Content for that paticular category.<?php } ?> How would I set it for the pages within the category? - I can do it like so: <?php if (category_id == 3 || page_id == 4 || page_id == 5) { ?>Content for that paticular category.<?php } ?> But that means everytime I add a new page within that category I would have to manually add the new page_id to the list. Is there a way to write it so it can display category_id and all pages within? Any help would be great, thanks. Paul |