Okay so I have several "articles" stored in a mysql database and am attempting to echo those onto a PHP page.
so on index.php I have
Code: <?php article_layout();?> (yes there is a require one to get the function but that works)
then page_layout is this
Code: <?php
function article_layout(){
$uri = $_GET['uri'];
if($uri == ""){
$uri = "home";
} else {
$uri = $uri;
};
$mysqli = db_connect();
$qry = "SELECT * FROM `articles` WHERE `uri`='$uri'";
$result = $mysqli->query($qry, MYSQLI_STORE_RESULT);
while ($row = mysqli_fetch_array($result)){
$layout = $row['layout'];
require_once('http://'.$_SERVER['HTTP_HOST'].'/themes/default/layouts/'.$layout.'.php?uri='.$uri.'');
};
};?>
which calls the relevant layout page (so the contents it layed out correctly)
now my problem is how to make this cope with more than one article, so far it is only display one article even if it should be display two. Any ideas?
Undefined Variable: PHP_SELF, pls help
Hi,Im a newbie on PHP / MySQL programming and Im running a script to search one field on my DB table. The results will show after I key in my search word but there's an error below that says:
Working with Global Variables
hi, I'm not really sure why the following code is returning a "Call to a member function getBanners() on a non-object" error message. Code: var $_model; function display
php or sql?
Sorry not sure if this is a sql problem or php the following code is supposed to delete data from the sql. However when I click delete nothing happens.Code:
problems with contact forms that are only protected against SQL injections
What could be a potential problem with contact forms that are only protected against SQL injections and have an admin side view for the enquiry ?
PHP search multiple input field box help
I am having a problem with my search script. At current it will simply search by a selected date which is a java based calendar that displays when using id='datedisplay' in the input form field below.
How to validate from 2 possible answers
Hi I hope somebody can help me with what will probably be really simple, I'm pulling my hair trying to get my head round it.I've got a contact form and I would like to add to it a couple of simple
Request-URI Too Large
I have created a simple submit form for a mysql database that puts a piece of code into database.But if I want to put a document of any decent length, eg. 500 characters (I guess), I get the error
help with image upload code
Hello,right now this code I have resizes images and then places them into the uploads folder is there a way to make this code upload the orignal file sizes into uploads and make it put the smaller
What is SAP Avatar ?
Hi All,
Comparing two dates
Hi GuysI have two dates I want to compare. Below is my current implementation. The problem with it is it always returns false:if(date("d/m/y", $course->finish_date) >