I've got a little sidebar that displaying in the code before the main page content. I wrote this (janky) function to pull in recent posts and comments. Works great, however, its screwing with all my pages and putting posts on all of them. How do I reset/rewind the query or make a new one so all my pages display the correct content?
<?ph...
Hello, I have a multilanguage site and I'm trying to rewrite the URL's with a fake directory something like this:
http://localhost/theSite/page.php?id=param&cat=param?lang=en,fr,es
to http://localhost/theSite/(en|fr|es)/page/param/param
.htaccess
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(fr|en|en)/(.*) $2.php?id=$1&ca...
I have local access to files, which I need to get their MIME types. Working in WAMP/LAMP, CodeIgniter, and Zend libraries. What's the best way to get MIME type information?
...
This is probably going to seem a little strange but we are using
<Files "*">
ForceType application/x-httpd-php
</Files>
Which of course forces all files to give html/php headers.. The reason I am doing this way is because were using a bunch of extention'less php files. I know there is plenty more efficient ways of doing this but my b...
I'm looking for a list of all locales and their short codes for a PHP application I am writing. Is there much variation in this data between platforms?
Also, if I am developing an international application, can I just support one version of English or are there significant differences in English across the world?
...
So Im working on a site(gaming community) that im aiming to release to the public soon. Currently Im working on the password part. I have only used md5 until now. I have read about password safety and heard that salting is currently the way to go.
How does this sound to you?
Every user has its own unique 12 length salt of random charac...
I would like to convert images that have been uploaded by the user (in various formats and conditions) to a vector image format such as .eps. I'm primarily working in PHP.
What options exist?
...
As a developer, I've learned a heck of a lot from the global community and I believe like any community, you need to participate and contribute.
I've worked on several small projects that I want to offer up for free, but I want them to actually be used.
For the sincerity of this post, I am not going to promote them here.
What are some...
How can I do this, as the most obvious way doesn't work:
<?php
class Inner {
public $var;
}
class Outer {
$test = new Inner;
}
?>
Yields:
Parse error: syntax error, unexpected T_VARIABLE, expecting T_FUNCTION in /f5/debate/public/test.php on line 10
...
I want to know if it's possible to create a GET form that has as action "search.php?what=bla bla" and in the url bar it shows "search/bla bla" . Then I can handle the search file and explode the search terms, but what is the rewrite rule?
...
An easy question to ask, hope not to stupid.
$var=0;
$condition="$var!=0";
if($condition) {
# do something #
}
else {
# do something else #
}
Obviously the code up there doesn't work as intended. Is there a nice way to obtain an if-condition from a string? Or do I have to parse the string in some disturbing way?
EDIT
I didn't...
How would I select all but the first 3 rows in my MySql query?
$query = mysql_query("SELECT * FROM comments WHERE approved = 1");
...
I am trying to connect my Java Applet to a MySQL Database. I know that it works, because I can connect to it on localhost and it retreives a list of records just fine. But when I put it on the internet, it doesn't work.
Here is my applet: http://mystikrpg.com/play
It's signed, but I keep getting the following exception:
SQLExceptio...
Hello,
I m using jquery validator plugin. i need to validate some field with some condition. how do we apply that?
i have a form where user select a country..then user creates branch on the fly,
now i want to validate that if user do not select a county then prompt to select country and if user select a country then prompt to cr...
I have two tables, sales and costs, each with a costs fields, and a date field of type date.
The rest of the fields are not relevant for what I want to do.
I want to take the totals of each month, and display them together.
I am unsure if most of this should be done in SQL, if it must be one or several queries, of if I must manipulate...
I have a class that uses PHP's ereg() which is deprecated.
Looking on PHP.net I thought I could just get away and change to preg_match()
But I get errors with the regular expressions or they fail!!
Here are two examples:
function input_login() {
if (ereg("[^-_@\.A-Za-z0-9]", $input_value)) { // WORKS
// if (preg_match("[^-_@\....
hi,
i have a select box where in it has a list of items and he enters value for each selected option and saves it .
i have written a function like.
$('.add_recordings').click(function () {
if (($('#recordings_name').val() != '') && ($('#recordings_value').val() != '')) {
if ($('#recordings').val() == '') {
va...
I'm using MCRYPT_DEV_RANDOM and MCRYPT_DEV_URANDOM as part of blowfish encryption, but I'm noticing it outputs the same random digit every time. It differs from machine to machine, but it's the same in each machine.
Is this normal?
Does it affect the strength of the initialization vector (IV) I generate with it?
...
Hello Everyone,
So I'm working on a script that's going to upload a video to a server via a RESTful interface. The documentation tells me that I should pass the data (including the binary video file) as part of a POST request. I know how to set my POST variables, but I'm not sure how to do the binary data. The API says I should have a ...
I have a website where drupal manage the contents, but another application handle the e-commerce (my customer doesnt like to change his own e-commerce)
I dont like to have the e-commerce to looks differently from the rest of the websites, so i've made a drupal Page node with php code in the body, that simply include the external app and...