If all CMS's (Drupal, MediaWiki) are just a collection of PHP or ASP in the background, then how do they display pages at www.site.com/directory/ or www.site.com/File_name without extensions or anything?
Is this some .HTACCESS configuration? Python? Perl? What could do this?
How could I do this for my server/websites? (Without using a ...
I've got a multidimensional associative array which includes an elements like
$data["status"]
$data["response"]["url"]
$data["entry"]["0"]["text"]
I've got a strings like:
$string = 'data["status"]';
$string = 'data["response"]["url"]';
$string = 'data["entry"]["0"]["text"]';
How can I convert the strings into a variable to access ...
I found myself struggling with me every time I am asked, which language to prefer for a web-application. Most people dismiss the importance of a good architecture. That why a answer that architecture is more important than the language. Afterwards sometimes I sompare the advantadges.
But that is always not about the language but im most ...
What's the best practice to handle errors if using objects?
A) Before the method of object is called and not even getting to execute method if there's some error, or
B) Just pass parameters and perform error checking in method itself, returning error code or something.
Please pick your option and short description, why?
Thanks orland...
In Java I can write a really basic JSP index.jsp like so:
<% request.getRequestDispatcher("/home.action").forward(request, response); %>
The effect of this is that a user requesting index.jsp (or just the containing directory assuming index.jsp is a default document for the directory) will see home.action without a browser redirect, i....
It was hinted in a comment to an answer to this question that PHP can not reverse Unicode strings.
As for Unicode, it works in PHP
because most apps process it as
binary. Yes, PHP is 8-bit clean. Try
the equivalent of this in PHP: perl
-Mutf8 -e 'print scalar reverse("ほげほげ")' You will get garbage,
not "げほげほ". – jrockway
...
I'd like to be able to replace things in a file with a regular expression using the following scheme:
I have an array:
$data = array(
'title' => 'My Cool Title',
'content' => ''
)
I also have a template (for clarity's sake, we'll assume the below is assigned to a variable $template)
<html>
<title><% title %></title>
<body><% con...
Hi
I have a CMS with a WYSIWYG editor which produces pretty good xhtml. Based on this fact, I think a HTML parser might be slightly overkill for this small job.
I am intending to use regular expressions but so far have been unable to get mine to match what I'm after.
I'm using PHP5.
I need to match the content of the 3 block level el...
I am writing an web application powered by
PHP, Smarty, JavaScript, CSS, MySQL.
There will be some classes, which will be used through out the application.
There will be some scripts which will use those classes.
Any good article, tutorial, architecture on how to organize files for a web site?
P.S. It should contain how to organize a...
I created a field in my table and set it as the index but I can't get it to increase on it s own when a new item is added. How do I do make it do this through PHPMyAdmin?
...
Hi,
I recently asked a question about matrix libraries in PHP.
I went with the suggestion of using the Math_Matrix PEAR library. However, it turns out that this library is out of date (meaning I had to change some of the code in the library to make it work with my version of PHP), and it doesn't really do what I need (e.g., it won't le...
How can i change ex. 2009-01-14 06:38:18 to 2009-01-14 06:38?
the column type is DATETIME. i dont wanna use SELECT DATE_FORMAT
how could i do it with php?
date("M-d-Y H:i", $userow['regdate']) gives:
Strict Standards: date() [function.date]: It is not safe to rely on the system's timezone settings. Please use the date.timezone setting,...
Per the example array at the very bottom, i want to be able to append the depth of each embedded array inside of the array. for example:
array (
53 =>
array (
'title' => 'Home',
'path' => '',
'type' => '118',
'pid' => 52,
'hasChildren' => 0,
),
Has a depth of one accordin...
I've been using HomeSite since Allaire owned it. I started with plain html, then classic asp, now I've been using it for php development for quite awhile but there's a feature I really want and Homesite only seems to do it sometimes. Most IDEs will show a list of functions on a page. Homesite will sort of do this with the Tag Inspector f...
Validating URIs for RFC 3986 is fairly simple. You can use a regular expression like:
/^ # Start at the beginning of the text
([a-z][a-z0-9\*\-\.]*):\/\/ # The scheme
(?: # Userinfo (optional) ...
I was using xampp to develop locally and then I installed the PHP from the direct installer. Now in some of my PHP code, only PHP code that starts with "<?php" is correctly parsed. Anything that starts with "<?" or "<?=" is completely ignored and just left as is.
How can I adjust the configuration to parse either tokens?
...
What do you recommend for setting the MAMP development stack? I've seen the quickstart thing at http://www.mamp.info, but I don't really like that approach. I'd rather have a full-fledged Apache that I can install any number of modules into. I remember seeing in the Leopard Server demo a really slick GUI that allows you to setup all this...
I have the following code:
$sql = "INSERT INTO table VALUES ('', ...)";
$result = mysql_query($sql, $link) or die(mysql_error());
$id = mysql_insert_id($result) or die('oops'); //mysql_error() instead of oops produces the same result
echo $id . "\nDone";
The table that this insert occurs on has an auto-incroment field however all that...
Why should I use templating system in PHP?
The reasoning behind my question is: PHP itself is feature rich templating system, why should I install another template engine?
The only two pros I found so far are:
A bit cleaner syntax (sometimes)
Template engine is not usually powerful enough to implement business logic so it forces you ...
Im trying to set up a session and i am getting a header error, dispite as far as i can tell i am telling it to start the session before the header is sent. any help here would be useful.
<?php
ob_start();
session_start();
$_SESSION['active'] = 1;
ob_end_flush();
?>
<html>
<body>
2009c Christ Redeemer Catholic Church
</body>
</html>
W...