I have a Joomla module that basically displays a list of categories. Next to the category name, the number of items in that particular category is displayed using the line below
<em>(<?php echo $row->counter ;?>) </em>
The items in the categories are set to either ‘open’, ‘close’ or ‘frozen’ and I am trying to make it so that it o...
I am new to AES encryption but trying to build a solution which:
Accepts consumer data
Encrypts that data using AES and a
"public" key
Store that data in a MySQL database
Have the ability to pull and decrypt
the data ONLY with a private key
(stored on my personal machine, not
the server itself).
I realize this may be overkill but wan...
I've been working on a script for debugging mod_rewrite, and when testing their regex system I've had some strange results. I'm wondering if this is normal behavior for the mod_rewrite regex engine or if some part in my code is causing it.
Requested URL: http://myurl.com/path/to/something
.htaccess has: RewriteRule to where
Using my d...
If I have three tables, and I'm trying to loop through all posts:
posts: post_id, post_title, post_content
tag_relations: post_id, tag_id
tags: tag_ig, tag_name
If each post will have multiple tags, how would I display each tag for each post?
As in, how would I have to setup my SQL query, and how would I print the results? Would it b...
Programming by contracts is a modern (?) trend in .net.
But what about libraries/frameworks for code contracts in php?
What do you think about applicability of this paradigm for php?
Googling of "code contracts php" gave nothing to me.
UPD:
for those who didn't even try to google for unknown term ("coding by contracts") and voted fo...
I am trying to learn to use PHP curl and it seemed to go well until I have tried to authenticate to changeip.com. Here is the function I use to make a Curl call:
function request($ch, $url, $params = array())
{
$options = array
(
CURLOPT_URL => $url,
CURLOPT_USERAGENT => 'M...
I run a mysql query and get the results successfully. However, I cannot read the elements of the array from javascript side. Can anyone help??
//JAVASCRIPT makes a request
function profiles(){
$.post('dbConn.php', { opType:"getProfileList" }, fillProfileCombo, "text");
}
function fillProfileCombo(res) {
alert(res);
}
//dbConn.php...
The code below echoes out an HTML table, populated with values from a MySQL database. The CSS changes when a field called "topten" equals 1.
When "topten" equals 1, I would like to have a rectangular background 100 pixels high, 800 pixels wide, and color #A6FFFF;. When "topten" does not equal 1, I would like there to be no backgroun...
I have a text area in HTML where the user can enter text, but when the form is submitted, and its passed to a php script which echo's it, there aren't any newlines. Knowing that HTML does that, I tried doing a preg_replace() before echoing it...
echo preg_replace("/\n/", "<br />", $_GET["text"]);
but still everything is on one lin...
Hi,
Incorrect key file for table '/tmp/#sql_185e_0.MYI'; try to repair it
What does this error mean?
"Incorrect key file for table '/tmp/#sql_185e_0.MYI'; try to repair it"
I'm inserting 400k records in a table by 25k per batch using PHP in command line.
If I inserted only 1k records then it will not produce the MySQL error.
Does ...
Hello, I am using wordpress 3.01, and would like to list a number of child categories within a parent in this format. Without links.
{ 'cat1' , 'cat2' }
Is this possible?
http://codex.wordpress.org/Template_Tags/wp_list_categories
this call seems like the right one, but I can't figure out how to list them without turning off links
Th...
Say I have this code in PHP :
$query = mysql_query("SELECT ...");
the statement returns a resource object. Normally it would get passed to mysql_fetch_array() or one of the mysql_fetch_* functions to populate the data set.
I'm wondering if the resouce object - the $query variable in this case can be cached in memcache and then a wh...
Hey there,
I am trying to create a dynamic image that will be created from PHP using GD... What I need to do is be able to specify the layering of one image over another. The images are supposed to overlap slightly and get smaller as you move towards the right of the image... however the only way I can get php to render the images to th...
this is a really basic question (I hope). Most of the exception handling I have done has been with c#. In c# any code that errors out in a try catch block is dealt with by the catch code. For example
try
{
int divByZero=45/0;
}
catch(Exception ex)
{
errorCode.text=ex.message();
}
The error would be displayed in errorCode.text. ...
Hey guys,
I have this contact form with codeigniter, and what I want to do is, when the form is submitted but does not pass validation, I want the fields to contain earlier submitted values.
There's one thing though: when the form is loaded all the fields already have a certain value assigned, so for example the "name field" shows "nam...
A certain blogsite allow its users to fully customize the entire html page of their blogg, change doctype and all, and they use tags for where they want the user to dipslay things like titlename and amount of comments etc.
i.e this is code you can edit and submit under blog design settings:
<tag:archivelist>
<li><a href="${A...
Hi there,
I have a site currently built on Wordpress. I have a requirement to pull out the "latest post" in a category (magazine issue), to allow the latest issue to be displayed in the sidebar of a Posterous blog template, either in an iframe or by other means.
What's the best way to achieve this? Shall I write a custom PHP page which...
I have got PHP 5.2.14 running successfully on Windows, with the LDAP extension loading and working correctly. I installed 5.2 because it appeared to be that php_ldap.dll wasn't available for 5.3. Now it looks like the Fileinfo extension is only available for 5.3!
(I'm a linux chap mostly, and have generally been sheltered in the happy...
What would cause this? Code follows:
$m = new mysqli($host,$user,$pass,$db);
if(mysqli_connect_errno()) die('Connect failed: ' . mysqli_connect_error());
$PrepSQL = "INSERT INTO Products (" . implode(',',$this->cols) . ") VALUES (";
$PrepSQL .= '?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
$stmt ...
First of all, let me just say that I'm using the PHP framework Yii, so I'd like to stay within its defined set of SQL statement if possible. I know I could probably create one huge long SQL statement that would do everything, but I'd rather not go there.
OK, imagine I have a table Users and a table FavColors. Then I have a form where us...