Member Avatar

I'm building a CMS in PHP and this is my first attempt to use ajax to do something cool. It's making my queryies problematic, however. I'm writing in this forum because my PHP forms worked fine before I did the following: On my index page, I have a header with a menu in one DIV and a content area in another. What I wanted was selecting a menu item to load the appropriate .php form in the content DIV. I found this fun ajax script to serve that purpose. So my menu items look like this: <a href="javascript:ajaxpage('lrs_addstudent.php', 'contentarea');">Add Student</a> …

Member Avatar
+0 forum 2
Member Avatar

Good day, I am working on atomizing a template creating includes in a sub-directory called includes and calling them like this <?php include 'includes/head.php'; ?> I have also tried <?php include('includes/head.php'); ?> My page won't load. All I get is a blank browser window. I tried tailing the error.log and nothing is appearing there. Googling the issue, I have come across this challenge some had on network servers after upgrading from PHP 4 to 5 and Zend optimizer. My server isn't complex as it is only a development environment. Has anyone else had a similar issue and can offer a …

Member Avatar
+0 forum 10
Member Avatar

Hello, I'm trying to replace {include %filename.php%} with that file from the server. I can get this to work file if the file is plan html text using the function below. [CODE] $str = "This would be a paragraph of text. {include %news.php%}"; preg_replace_callback("/\{include %(.*?)\%}/", function($m) { return file_get_contents(CORE . 'includes/' .$m[1]); }, $str);[/CODE] But if the included file contains php code for example [CODE]<? echo "Hello World"; ?>[/CODE] It doesn't work, it just prints "echo hello world". If i change [I]return file_get_contents[/I] to [I]include[/I] it includes the file before my string of text. Unlike how the string is originally …

Member Avatar
+0 forum 24
Member Avatar

Hi, I have this codes: (index.html) [CODE] <body> <div id="wrapper"> <?php include('includes/header.php'); ?> <div id="nav"> <a href="#">Home</a> <a href="#">About</a> <a href="#">Portfolio</a> <a href="#">Contact</a> </div> <!-- end #nav --> [/CODE] I wonder why <?php include('includes/header.php'); ?> does not works. In other words, the codes that I have place in header.php does not appears in index.html when I run it in IE. includes/header.php [CODE] <div id="header"> <h2>1stWebDesigner PHP Template</h2> </div> [/CODE] no errors. It's just after I cut and paste the codes from index.html and move it header.php and writes: <?php include('includes/header.php'); ?> , the header disappeared. What might be the problems …

Member Avatar
+0 forum 18
Member Avatar

Working in the WAMP test server enviroment. I want to be able to register, login and logout from any where in the site, so I included the login form with relative URLS in the header.php file. This all works fine on the root directory but breaks as soon as you reach any off the subdirectories. [code] On the root folder login = http://mytest/login.php on a subfolder login = http://mytest/subfolder/login.php/login.php [/code] For each subdirectory I drop to I place a corresponding ../ and it works because it finds the file header.php file. The only problem is the URL actions with the …

Member Avatar
+0 forum 1
Member Avatar

Hi all. Having more problems with utf-8 and Iñtërnâtiônàlizætiøn. I'm running php (xampp) on Windows 7 (but it's also happening on my remote Linux site) and keep on getting nonsense with non-ASCII chars when they come from include files, e.g. INCLUDE FILE: 'inc.php' [CODE]<?php $simple = "Iñtërnâtiônàlizætiøn"; ?>[/CODE] MAIN FILE [CODE]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="cy-GB" xml:lang="cy-GB"> <head> <meta name="language" content="Welsh" /> <meta http-equiv="Content-Language" content="cy-GB" /> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> </head> <body> <?php include_once("inc.php"); echo $simple . "<br />"; echo "Straight: Iñtërnâtiônàlizætiøn"; ?> </body> </html> </body> </html>[/CODE] I get this: [ATTACH]20097[/ATTACH] I've tried putting …

Member Avatar
+0 forum 6
Member Avatar

Just wondering but is there a way to include the meta tags from one page to another? The reason why i ask this is that i built a website using PHP Includes and want to include the meta tags so when i load index.php?id=About , it will load the meta tags from the include page and not from the main index.php page? Before you suggest using URL Rewrite to make the URL's look better i already am :) Let me know if you have a answer to this :)

Member Avatar
+0 forum 2
Member Avatar

Is there a particular reason as to why some people use .inc and some just use plain .php for include files? Does actually do anything performance wise or does it just make it easier to distinguish between files?

Member Avatar
+0 forum 4

The End.