Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




CMS W/ Static Pages


I'm looking for an open source php CMS solution that will generate
static html pages.




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Dynamic Or Static Pages?
I just created a new site, where I have my products stored in my MySQL database. I've used mod-rewrite to parse out the "brand" and "productname" from my URL's, so they look more SEO friendly...ie:

http://example.com/brand-product.php

Problem is, I'm not sure how to handle special characters in the URL... as all of my URL's now have #134;, reg;... and other decimal and entity equiv's in them.

I can only think of one way around this, which is by using static pages... which I'm hesitant to do(have php spit out a product page for each product).

Static Content Management -- Baking Pages Rather Than Frying Them
I'm looking for a tool or series of tools to help me manage the
content of a website. My request is odd because I have no need to
manage content on-the-fly. I would be happy to regenerate pages each
time the content is updated.

I'd need to be able to --
+ supply a 'template' HTML file
+ a file (or optionally a database) to pad out the template
+ include dynamically created navigation -- breadcrumbs and main menu
for each page

I'd be happy to work in Perl or PHP, but must be able to use these
tools on a Windows platform. My preference would be for Open Source
software.

Can you let me know what the 'state of the art' is in this niche area?
I have looked at some Perl scripts, but they seem not to work on
Windows (and this is backed up by other user's comments).

PHP Script To Generate Static Pages From MySql Database.
I need to create static pages from a database and I cannot find such a script. 
The script must be able to create a static page from every record in the table and give it a URL and also create a static index page with links to the pages created from the table.

Avioding Expired Pages, & Carrying Data Accross Multiple Form Pages
I have a checkout/order form that consists of 6 pages, all PHP. The are linked to one another, like, after the user finishes page 1, they proceed to page 2, etc... The first two pages are submitted by a GET link, so those are not in my question. The next 4 are submitted using a <form>. Throughout all of the pages, i would probably have about 25-30 variables, things that the user has to fill out. I have two questions,

1. What would be the best way for me to keep track of all the data moving throughout the pages, like storing it from page 4, and i still need to access it on page 6.
2. I don't know if anyone could help me here, but does anyone know of a way to code around those ugly "page expired" pages, because of a submitted form. If a user needs to go back, which most likely they will, is there some sort of way for me to skip the expired page?

Converting Html Pages Into Dynamic Pages
I built a website in html, using Dreamweaver. I need to have a database built within these pages and the person who is going to do it told me that they will have to convert all my html pages into dynamic pages (php).

Is it complicated to do this or do I just have to save my pages in php instead of html in Dreamweaver ?

Static Url
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
rewriterule ^article/(.*).html$ /read.php?articleid=$1 [L]
</IfModule>

Using mod_rewrite will transform my url into static one? In the above code, the article/ becomes part of the physical url. http://localhost.com/article/
how could this be when the RewriteBase must be http://localhost.com/

Static Method In Php
Is there any way to simulate static method in php ?

CMS V Static Html
I have a #1 web site in the Google search engines all done in static html. I
am redoing the site using CMS (Joomla) and would like some opinions as to
how this might affect my search engine ranckings, especially Google.

Session ? Static ?
I have a function that returns data from my db as an array. To reduce the
times the script
has to access the db should I store the contents of the variable in a
session variable and
access it that way, or should I figure out how to set it and use it as a
static variable ?

I was thinking doing an isset on the session var, if exists, use it, if not,
hit the db and store the
session var. Also, the data that is stored in the db will not change too
often, my sessions will
expire way before that so I dont have to worry about "stale" data.

Static Scope
In server-side scripting, to whom are static members available? Since it's executing on the server, can one visitor get a static property value that was set by the actions of another?

PHP Static Scope
I'm kinda new to PHP and I'm running into something that just seems
odd. There's a good chance I'm just doing something wrong though. I'm
trying to implement a simple singleton:

private static $instance;
public static function Instance()
{
if (!isset(self::$instance))
{
self::$instance = new MyClass();
}
return self::$instance;
}

which pretty much follows the common pattern. I've noticed through,
either by using a var_dump on self::$instance or by simply outputting
"test" inside the IF statement, that my if statement always executes.
If I call Instance twice within the same request, the singleton works,
but if I refresh or open a new browser, each request seems to create
it's own version. Am I doing something wrong or are static's scoped to
thread requests? I would expect the block within the if to fire once
throughout the life of the application (or until php resets itself or
whatever).

I'm just messing with things on IIS - incase that could be the issue.

Are There Static Functions In PHP?
I have two files which implement functionality in many of my web pages. Each
file uses a function named "parseArguments()" that's critical for each of the
two files.

I often include both files into one webpage, which results in a name clash
for parseArguments().

What I really would like is the concept of static functions from the C
programming language. A static function is one that has strict file scope:
no function outisde the containing module sees the function.

Is there a way to limit the "linkage" of a function to file scope only?

How To Use The Keyword 'static' In PHP 4?
In the code below I'm getting a parse error on this line:

static $controllerForAll = new McControllerForAll();

why does this give me a parse error? I'm running PHP 4.

function & getController($callingCode=false) {
// 11-27-04 - we want to get the controllerForAll variable, and we
want to make
// sure that it is always passed by reference. Rather than having
functions do
// something like this:
//
// global $controllerForAll;
//
// we instead want them to use this function. This adds a wrapper to
the way we
// this variable and thus allows more flexibility in changing the
access later.
// After all, it may not remain in global space in future versions of
the
// software.

// 12-12-04 - we declare controllerForAll to be static, therefore the
second time
// this function is called it should already exist.

if (is_object($controllerForAll)) {
if ($callingCode) $controllerForAll->setCallingCode($callingCode);
return $controllerForAll;
} else {
$controllerForAll = & $GLOBALS["controllerForAll"];
if (is_object($controllerForAll)) {
if ($callingCode) $controllerForAll->setCallingCode($callingCode);
return $controllerForAll;
} else {
if (class_exists("McControllerForAll")) {
static $controllerForAll = new McControllerForAll();
if (is_object($controllerForAll)) {
if ($callingCode) $controllerForAll->setCallingCode($callingCode);

return $controllerForAll;
} else {
echo "Awful sorry, we were looking for a software object called
'McControllerForAll' but we were unable to find it. The software
really, really needs it to work.";
}
} else {
echo "Awful sorry, we were looking for a software object called
'McControllerForAll' but we were unable to find it. The software
really, really needs it to work.";
}
}
}
}

Templates -> Static Page
I was wondering if i can get help on how to go about writing a file using a template. The template does several calls to the database and all parses out nicely.. but i want to save that as a static html page.

I've tried to use the fputs but it needs a string... and I'm stumped here. Has anyone tried doing this and has an example I could follow?

Calling A Static Function.
I have to call a bunch of static functions where class names are
stored in a array.
So I have:
$my_array = array("class_1", "class_2", ... and so on...)
So I tried this piece of code to call static functions attached to
each classes like that:
foreach($my_array as $classname)
$classname::MyStaticFunc(...);...

PHP Static Page Creation
I'm creating a system that will build out numerous static pages from database content. Right now, I'm just getting the basics down and I have a test going. I found a script to build out pages, but the problem is: it outputs the results of ALL the pages made to the browser. Is there anyway to stop this? (There will be near 500-1000) pages being made in the end. The code below creates 5 test pages "0_test_page.htm" etc. with the html content in the middle. Here is my test coding:

MVC Patterns On The Web And Static Resources
Hi all,

This may have a really simple answer to it, but I can't seem to figure
it out no matter how much I think about the problem. I'm working with
an MVC framework (presently the most recent version of the Zend
Framework 0.93, but no too committed with the project to prevent me
from switching gears to a different framework), but I am having one
heck of a time when attempting to reference static resources such as
javascript scripts, or style sheets, I haven't tried images but I
suspect I will have problems with those as well.

I am currently running an Apache 2.0 web server through the XAMPP
application (simpler to setup), and in my application root directory I
have a .htaccess file with rewrite rules to redirect the browser's URI
to the proper one (base URL's index.php file, effectively the
bootstrap file)

It seems to be a [interpreted] relative path issue as when executing
the front controller off of a web address similar to the following:
http://www.example.com/ or http://www.example.com/index.php

The static resources are presented properly. Using the MVC framework,
the default action for the above front controller is the index Action--
now if I explicitly tell the browser what action to execute and I tell
it to execute the index action like so:

http://www.example.com/index/ or http://www.example.com/index.php/index

My static resources suddenly disappear. The only explanation for this
that I have, is the fact that no longer would the styles be found
under the ./styles directory but the ./../styles directory. Thus,
despite the fact that the system is getting the content in both
examples above (the one that works, and the one that doesn't) from the
same action controller, the only thing different is the interpreted
path shown in the URL bar. I can't figure out whether it is something
I am doing wrong, or whether it is the nature of the MVC architecture
that paths to static resources can't be derived from the Front
Controller in the root directory. It should be noted that I have
extended both Front and Action controllers, though the constructor
behavior of each extended class behaves the same exact way as the
parent.

I'm setting the styles as an array of paths that are set in the action
before a view is rendered, there could be a case where certain styles
(or scripts) were used by one page and not by another thus, while
these resources are static they are being assigned dynamically... for
instance:

public function indexAction()
{
$tpl = new Zend_View();
$this->addStyle("./resources/styles/style1.css"); //
convenience function
$tpl->assign("styles", $this->getStyles() );
$tpl->assign("scripts", $this->getScripts() );
...
echo $tpl->render("page.phtml");
}

1) Is the Zend Framework stable, and developed enough to use over
CakePHP, Solar, or any other framework out there, and what would
people recommend if they feel that Zend's framework isn't quite ready
yet?

2) Under ZF, or any other framework for that matter, while it may be
the single index.php file that gets executed to initiate the
Controllers and Views, why wouldn't it have the correct path for a
static resource always in the same place? Is this a shortcoming of
the MVC architecture, the framework implementing it, or my own short
sighted implementation?=

Static Storage Of Data
I am running my PHP on Apache server on Linux.Now my problem is as follows.
There may be several clients connecting to my server for some jobs
whenever a client connects i am executing a php script which connects
to a MySQL database and gathers some table information into an array.
So in this case every time a client connects to my server i have to
connect to a database and and read it into an array.My question is that
is it possible to store this information (asuming that my database table
information is the always the same)in an static array or any user defined
superglobal so that once i start my apache server it reads this information
and stores it somewhere in an array..so that from then onwards there
is no need to connect to the database whenever a client connects.I also
do not want to hardcode this information in a file and read it from there
everytime a client connects.

Dynamic To Static Optimization
Since this is a newsgroup about php & web related topics, I wanted to
share a new Search Engine Optimization tool that we just released. I
know many of you have non optimized dynamic sites (php + mysql) and so I
believe the D2S system could be a large benefit.

It's called D2S as it has the ability to take an non optimized dynamic
web site, and turn it into a highly optimized static web site! We have a
free demo which also shows you a number of important statistics.

Acroterion D2S Online website optimization tool will scan your website
to locate potential problems and conditions that can impair your site's
searchability. It collects and identifies a range of SEO components and
provides a set of detailed reports to help you analyze all potential SEO
website issues. The reports highlight specific issues which are grouped
under four major categories: 1) Site Status, 2) Searchability, 3)
Accessibility, and 4)...

Php 5: Static Class Variables
I noticed in my static example which I did in PHP that the static
variable is not stored over multiple php pages. So this does differ
than to other OO languages like JSP. Is this so or did I something
wrong?

MyClass.php:
<?
class MyClass
{
static $MyVar = 123;
function getMyVar()
{ return MyClass::$MyVar; }
}
?>

1. Call on my server
MyPage1.php
<?
require("MyClass.php");
// set here the value
MyClass::$MyVar = 456;

echo MyClass::$MyVar; // prints 456

myInst1 = new MyClass();
echo myInst1->getMyVar(); // prints 456

?>

Opinions On Static Vs. Dynamic
We have a site that has long used Perl, and had a database, but didn't use it to its full potential. This summer, we converted to a PHP/MySQL based site.

We have approx. 20,000 users/day ... and, on various pages, we pull in articles and/or raw statistical data out of the db. There's approx. 800 and growing records in the articles DB, and other tables have a set amount of data, usually around 3,000 records in one, 800 in another, 2,000 in another, from which at times we do a number of joins, none too complicated. Oh, and we have, for argument's sake, about 512MB of RAM. Some of these dynamically generated pages only change, say, twice a week.

The question is are we better off creating static pages and serving them that way? Or are we fine, given our user load, to serve dynamic pages? I'm pretty new to this - and maybe this is an age-old question - I don't know. But I'm wondering. I find dynamic content much easier to deal with - you don't have to worry about storing a number of files on the local disk, and the code is easier.

Others, however, are worried about server load. When we create static pages, we check the database to see the latest update, and check it against the timestamp of the most recently-created static file. If there's new data, the static file gets rebuilt from the database data . If not, the current static page gets served.

I'd contend that this process is actually longer and more server-intensive than just serving the dynamic page every time. On the other hand - what if you use a perl cron job to create the static page at a certain time every day. Is that better/worse/doesn't matter?

[php5] Static And Inheritance
How do I use static functions/properties with inheritance? I've found it
very problematic.

class Foo
{
static function A() {/* ??? */::B(); }
static function B() {echo 'Foo'}
};

class Bar extends Foo
{
static function B() {echo 'Bar'}
}

I'd like Bar::A() to respect inheritance and output 'Bar', but I can't
figure out how to make call from base class to static methods of inherited
class.

Is there equivalent of $this for static calls? Or something being reverse
of 'parent'?

Which Is Better: Static Or Dynamic Extensions?
I like the idea of compiling DSO modules for Apache. It allows me to turn
on or off things we may or may not need at a given time (like mod_ssl,
mod_auth_mysql, mod_auth_ldap, etc.) and also allows me to compile in new
versions of modules without having to rebuild Apache from scratch.

Now, when I build PHP, I tend to put in a lot of things. Like:

../configure --with-mysql=/usr --with-openssl --with-pdflib=/usr/local --with
-bz2 --with-mhash --with-mcrypt ...

etc. etc. All of these modules are things that we use, but some of them not
very frequently.

So I'm trying to learn more about PHP's dynamic extensions. I didn't even
know that they existed, until I looked at the php.ini and phpinfo() output
of the PHP version that comes with RedHat 9.0. I see that instead of doing
things like:

./configure --with-mysql=/usr

they do

./configure --with-mysql=shared,/usr

So I guess my questions are:

1) Where can I learn more about PHP dynamic extensions? Maybe I'm looking
in the wrong places, but the documentation on them seems to be quite light.

2) Can *any* module be compiled as a dynamic extension, just by putting
"shared" in the appropriate place in the ./configure command? Or just a
few? How can you figure out which ones can, and which ones can't?

3) What are the advantages and disadvantages to making dynamic extensions?
I'm guessing that advantage=smaller core PHP and disadvantage=slower initial
load time. Is that right? Anything else?

4) Similar to #3, is building dynamic extensions whenever possible
considered a Good Thing? Or are most people just still building everything
into a single monolithic libphp4.so ?

Static Variables In Classes
I have a problem with static variables in php. How do I access static variables in the super class that are declared in the child?

class SuperClass
{
public static function connect()
{
echo $user;
}
}

class ChildA
{
private static $user = 'John'
}

class ChildB
{
private static $user = 'Smith'
}

This does not seem to work.

Static Classes And Methods
I may have more of a design problem, but here goes.

I have a class that has 3 methods. One method simply calls the other
two. I wanted to make the class static, and to do this in php, you
just have to make the function static. So I did that for all three
functions. But now I cannot call the other two functions from the...

Get Class Name Of Static Method
Please see the question in the code below:

<?php

class A
{
public static function test()
{
// how to know the class name
// associated with the method call?
}
}

class B extends A
{
}

B::test(); // in test() method, how to know class 'B' is used for the invocation?



Static To Dynamic Using ReadFile
First of all, this is what i am trying to do...

Convert my 15000 static html and repetative pages to a database, php and ajax environment. All my html pages are 100% consistant, they are table based, they have around 16 fields in 2 colums inc images and links, etc...

What i want to do is this...

I want to read all 15000 files in, and then spit them out in a plain format and use some type of loop to create a csv or other type of file i can use to import all records into mysql?

I have been messing around, and found that i can read in a file using php and do all sorts of stuff with it, ie strip the tags, and output as html code etc, but i am a little lost now on how to achieve my task.

Sending People To Specific Pages That Are Coming From Specific Pages...
I want to show some specific pages to people that comes to my site from
specific urls, I know the variable $_SERVER['HTTP_REFERER'] will be
used but how?

For ex if the visitor comes from a site that is like:

I want to send this person a specific.php . I used below code but not
worked:

<?php

if($_SERVER['HTTP_REFERER'] == "www.cominghost.com" ||
$_SERVER['HTTP_REFERER'] == "cominghost.com" ||
$_SERVER['HTTP_REFERER'] == "www2.cominghost.com"){

// Specific page html goes here

}
else
{
header("Location: index.php");
}
?>

This code not worked for some cases like if the visitor comes from
http://www.cominghost.com/account/targeturl.php or
http://cominghost.com/account/targeturl.php Ok I know the if statement
not working but How?

News Feed On A Static Site
I need to provide the news feeds on a static site, i was just thinking how to
do so, any pointers, the feeds will be like the latest news to be changed every
week, And perhaps will be on the home page only.

PHP Image Generation Or Static Files?
I've created a PHP script which generates images containing email addresses.
Over 1,000 users can change their email address, color and font styles to create a small customized email image.

Currently, the images are dynamically generated by a simple PHP script (using PHP functions: imagecreate, imagecolorallocate, imagettftext, imagegif). It uses/includes a (200 KB) TTF font file to create the text on every request.

I'm thinking of saving static images, recreated every time users make a change (not so often), so that the many image requests are not processed by a PHP script, but lead to static images (saved as GIF image files on the server).

My question is: does the last option use much less server resources?
Will the PHP script use a lot of memory, if requested every few seconds?

Trying To Display 1 Row Of Data On Static Web Page
I have a database with about 600 rows of data, and about 40 fields. I want to display 1 row of data at a time and populate it into a static web page in misc areas on that web page.

I am having trouble displaying the results! Do I still need a loop even though I want one record at a time? Code:

PHP Limitation: Static Inheritance And Scope
As many people have noticed by now, PHP exhibits some frustrating
behavior when it comes to static fields and methods. For instance,
when a static method is defined in a parent class, but called from a
child class, the method uses the parent class for scope (not the
originating child class). For example, see the following block of
code:

class Parent {
private static $className = 'Parent'

public static function getName() {
return self::$className . "
";
}
}

class Child extends Parent {
private static $className = 'Child'
}

echo Parent::getName();
echo Child::getName();

------------------------------
Intuitive Results
------------------------------
Parent
Child

------------------------------
Actual Results
------------------------------
Parent
Parent

Does anyone know if the PHP dev team has plans to remedy this issue? I
personally feel that the inability to handle static scoping with
inheritance is a major limitation to the OO functionality of PHP. I've
seen several relevant bug reports on bugs.php.net, but most have been
categorized as Bogus. One member of the dev team flat out insulted one
of the bug reporters, saying "Sorry, you have a complete wrong idea og
OO programming. [sic]"

http://bugs.php.net/bug.php?id=30140
http://bugs.php.net/bug.php?id=30423
http://bugs.php.net/bug.php?id=30934
http://bugs.php.net/bug.php?id=30235

However, reading through the various bug reports, I wonder if the dev
team may be softening just a bit in their resistance more recently. I
recommend voting for the bugs above, submitting more functionaity
requests, and continuing discussion in developer forums. Short of
fixing it ourselves, what else can we do to convince the PHP dev team
to address this problem?

Static Build Of PHP5/Apache2
A plethora of articles on building PHP & Apache1 statically exist on the
web. However I have not been able to find a similar document on a static
compilation of PHP in an Apache2 executable.

I know using a modular (DSO) approach has gained popularity and is
considered 'the way forward' according to many, yet I'd still like to
build a monolithic version for a box I am configuring.

Is it all all possible with the later versions of PHP/Apache2?
Links and pointers _very_ welcome. Of course I'd be happy to also go
into the modular vs static debate,

Does Mod_php Also Handle Static HTML?
I've recently considered switching from mod_perl to mod_php because
mod_perl, unless configured with multiple servers/ports/IP addresses, serves
static HTML from mod_perl processes, which is grossly inefficient. Since I
do not think you should have to tamper so much with server configs to do web
development efficiently I'm considering mod_php instead. I need to know if
PHP handles this differently:

- Are static HTML requests handled through a normal HTTPD process rather
than a mod_php process?

- How does the memory/process compare for a similar script written in
mod_perl/mod_php? Is mod_php more efficient in its use of memory?

Call A Static Variable From Instance
It's possible to call a static variable/method from an instance:

Object::my_static_var

I need to do something like this

$obj = new Object(); // (I have dynamic Object type)

$obj::my_static_var

There's any workaround?

Dyanmically Call Static Member
Is it possible to dyanmically call a classes static member or property?
So something like

class test1 {
static $staticVar = "Help";
}

$className = "test1";
echo $className::$staticVar;

PHP5 And Static Functions/vars
I need to add a string to a class var, but it doesn´t work though I read it
is a new feature in PHP5. This is my code:

class Huh{
static $message;
public static function addMessage($message){
Huh::message += $message."<BR>";
}
}

What´s wrong?

Interesting But Also Dangerous Static Method In PHP
The following code works, and that bothers me. Actually two things bothered
me:

1) Essentially PHP is not very strict about static and non-static. function
say() is not declared as static, but it was written as if it is static: the
use of self:: and accessing a static value, and it can actually be accessed...

Static Member Of A Class And Inheritance
I have this piece of code:

abstract class Kaos
{
static $foo;
abstract function MyFunc();
}

...
$bar = "aaa";
class Kronos extends Kaos
{
function MyFunc() {
echo self::$foo;
}
}
Kronos::$foo = $bar;

...
$bar = "bbb";
class Zeus extends Kronos
{
function MyFunc() {
parent::MyFunc();
echo self::foo;
}
}
Zeus::$foo = $bar;


At this point i would like that this code to show "aaabbb", but it
shows "bbb";

$a = new Zeus();
$a -MyFunc();

Why ? I think that i have misunderstood the meaning of 'static' keyword for a class member, but i need a field that has the same name in each class, but in the calls of Kronos (of a Zeus object) its value is "aaa" and in the calls of Zeus its value is "bbb".
How can i do this? Is possible?

Convert PHP Output To Static HTML Files
I want to create a static HTML page for every single record of a MySQL database (to improve performance and search engine rankings as well). The approach should by like: open file showrec.php3?id=1234, read formatted html code into array and write the array into a file rec1234.html. Does anybody have a solution?

Static Html With One Dynamically Served Line?
I've a site with static HTML product pages. I would like to make the price on these pages dynamic so that when all of the prices change, rather than change them on each individual page, I can just change them in one place.

But just the price in the list of product details that I wanted to serve dynamically.

I've had a couple of posts back from my first query who say PHP is the way to go, so I thought that I'd come to the masters and check it would be able to do this?

Static Array Holding POST Vars
I have a very strange behaviour in my php script and already searched for hours to find a reason - till now with no luck.

My script handles a form which is resubmited to the same php script. So in this state I get the $HTTP_POST_VARS variables. Then I branch to another php script and come back with some parameters in the URL.

In that state I have to access the previous POST variables. So I thought to use a static array. static $savevars=array(); In the "analyze_form" section of the script I do a $savevars = $HTTP_POST_VARS; and check the contents afterwards - thats ok. When I come back to that script the $savevars array is empty.

Static Method To Get Class Variable (PHP4)
In order to make static class variables accessible in a clean way I try
to write a method in the base class, as shown in this example:

<?php
class baseclass
{
function get_static($varname) {
return $$varname; // here's my problem
}
}

class childclass extends baseclass
{
var $types = array('text', 'password', 'hidden');
}

print_r(childclass::get_static('types'));
?>

This throws a notice:
-> Notice: Undefined variable: types in test.php on line 5

Some modifications I tried on the return statement:

return $this->$varname;
-> Notice: Undefined property: this in test.php on line 5

return self::$varname;
return self::$$varname;
return self::${$varname};
-> Parse error: parse error, unexpected '', expecting '(' in test.php
on line 5

I encountered that the same errors occur if no inheritance is used, this
does not work either (with the same modifications as above):

<?php
class childclass
{
var $types = array('text', 'password', 'hidden');
function get_types() {
return $types;
}
}

print_r(childclass::get_types());
?>

I wonder if I try to do something inappropriate, or if there is just
something I am missing?

Best Way To Implement Static Global Variables (in An Extension)
I wrote a multilanguage cms system a few years ago. Different languages are
handled by loading php-files where each language-specific string is
assigned to a normal php-variable ($LNG[] array).

This loading takes place for each request.

Now I'm developing a backend server in C++ that will allow some better
security-checking, session management and caching. The backend server has a
companion php extension module.

I want to make as few changes in the .php files as possible. Several
companies has used and extended the cms system, and if I change the cms's
API, they will have to hire programmers to update their code.

To make it easy to maintain the system, I want the language-texts to be
stored in a MySQL database. I want the backend server to handle this table,
and feed all the texts to the extension module when it starts up (one copy
pr. process or in shared memory - that is not important).

So - my question is: How is the best way to implement static global
variables in the extension module, without affecting the cms systems API?
(Today the .php files use the $LNG[whatever] syntax to get a language text
string.)

Need To Speed Up A Static Mysql Lookup Table
I am using GeoIP, which is a huge country / ip table that lets you look up users countries of origin.

Is there anything I can do to optimize the lookup speed. From what I know of binary searches, this should be able to be done incredibly fast if mysql knows the table is sorted, isn't going to change, and searches like a tree.

Anyone have any ideas?

Hiding Static Content If Column Is Null
I have a page that is pulling information from a database of local businesses. One of the columns is a URL and on the page I have a link 'Visit website' and the url from the database is the link. However, not all the entries in my database have a website and are null. So this is creating the problem that some of my listing have a link that says visit website, that go nowhere. This is the code i am using:

<a href="<?php echo $row_Businesses['website']; ?>" target="_blank">Visit Website</a>

What I would like is, if the 'website' column is null then the visit website link doesn't appear but if there is an entry for the 'website' column then there is a link saying visit website that has the 'website' column entry as the link (like above).

Saving A Dynamic Php-file As Static Html (on The Server)...
- I have a problem trying to save a dynamic php/mySQL online order form as static html on the server - I'm not really sure this is possible at all - but my problem is that the order-form consists of a lot of items (100+) + the customer data - and we simply don'y have the kind of database capacity to store each order in a database.
As stated earlier I don't know if this is possible? - the static files should also be named after variables so that it would be possible to search a directory on the server for specific orders (that is $blah_$blaah.html) - but that's not a problem - I know how to do that.

Parsing A RSS Feed And Generating A Static .html File With PHP
I have this small project for my site, if you can't point me to some resources or help me out I'll thank you very much.

The homepage of my site points to the different services I offer (chats, forums, my blog and a podcast for spanish speakers). I want to make this homepage more dynamic, but since the homepage gets more than 10000 daily unique visitors I don't wanna make it a .php file ('cause my hosting provider might get mad with the server's resources).

So what I need is to program a php script that I would run on-demand (probably 1 or 2 times a day) and that would make this:

- Parse the RSS feed of my blogs and the forums
- Generate a static .html file (the homepage) with the normal content plus the headlines from the feeds.

That way everytime I update my blogs I could run that php script to re-generate the homepage, with the updated info from the feeds.

Any help, suggestions, comments, links on how to do this will be very helpful. I'm not very experienced with PHP (I come from J2EE development), but I'm armed with 2 PHP books as a reference.

Function Parameter Passing? Session? Static? Global?
The 'main' page contains a call to a function in an included file. This
function puts a html-form on the screen. Before the form gets posted (to the
'main' page) some prior errorchecking is done. The form fields are then sent
and an object is created (all in the same function).
What I need ( imo ) is an array with objects that can be written later to a
dbfile to preserve.

But I cannot find a solution for the extension of the array.

the function statements are simply these:

< inside function in included file >
$o = someObject( $s ) ;
$objarr[] = $o;
</ inside function in included file >

As this array is within a function it is local to this function.
As I understand it now a good solution would be to pass the array to the
function.
In the 'main' page I made a variable $objarr that is passed into the
function like this:
<'main' page>
$objarr ;
function( $objarr )
</'main' page>

The PHP manual states that in the absence of the array variable it gets
created. {Does this mean that function( $objarr ) would suffice? }
However,
whatever I try, I end up with the creation of $objarr[ 0 ] only.


Copyright © 2005-08 www.BigResource.com, All rights reserved