I was wondering if it was possible to assign an array to a variable within a Smarty template file? I have tried this
{assign var='file' value = array('dir','doc','exe')}
But when I print out the array it produces this:
array(\'dir\',\'doc\',\'exe\')
How can I stop Smarty escaping the array values?
Thanks in advance
...
I am building a small gallery that will only have 20 or so images in it. I'd like to have this data stored somewhere (even in the PHP file itself) and so am looking at ways of encoding the data as a literal or resource file.
In JavaScript, I would use notation resembling (from memory):
var albums = [
{ name='Album 1', photos=['photo...
I have the following <DIV>:
<div class="general">
Some content here
</div>
I want to do a PHP include just before
Is this possible in PHP?
...
I'm developing a CMS for my university. With this Cms university staff can login and design their personal web sites without any knowledge of html or php.
What i want is sperate all external applications from my CMS. For example, there is a Polls application, Gallery and Images application and so on. And others programmers will work on ...
We are using CkEditor on our CMS product and does not want to use the built in spell checker from spellchecker.net. Does anyone know of other plugins, like e.g. the old FCKeditor plugin which used aspell serverside?
...
Hello all,
I have a bunch of fwrites that write to a text file. However, its seem that the new line ("\n") that I want after each row never gets put in since the next set of data is stuck to the last line that this code inserts into the text file:
while(odbc_fetch_row($result)){
if($counter==0){
$counter3 = 1;
...
Hello guys,
Please I need your help, Here is my encryption codes in PHP, it works fine but I don't know how to decrypt it in PHP. I need to get the actual value back. I have similar code in c# and I was able to get the same results. But I need to decrypt the value.
<?php
$DATA= 'james' ;
$KEY= 'moveme';
$hash = hash_hmac("sha256", ...
What I'm trying to do is, replacing symbols that would be changed start the string then the last symbol that would close the string - changing both of them into a link then it will be stored into the database, it's something like Wikipedia.
I want to have something like this when someone types in the textarea:
"This woman was killed by...
In my code editor, it normally displays PHP code in bold blue print. I'm finding some of my code is not showing up as bold blue print. Can someone please look at the code below and tell me if I'm doing something wrong? Thanks in advance.
<td class="hr"><?php echo htmlspecialchars("payroll number")." " ?></td>
<td class="dr"...
This is the function:
function NewsDat($url="http://www.url.com/dat/news.dat", $max=5){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$curlresult = curl_exec($ch);
$posts = explode("\n", $curlresult); //chop it up by carriage return
unset($curlresult);
...
I've got a set of form validation rules that I wrote with the jquery validator plugin. Since I have to repeat the same validation on the server side, I thought it would be nice not to have to rewrite my rules in PHP. If the rules were simple field=>rulename=>value I could just store them as JSON and decode them into PHP arrays. Unfort...
I want to match the values for A and C, but only if they are within the same paragraph.
A:one
C:foo
A:two
B:rofl, some rubbish :::
A:three
B:lol
C:bar
Right now I'm using
/A:([a-z]*).*?C:([a-z]*)/s
But that gives me "two" and "bar", which don't belong together. How do I exlude the empty line in my /.*?/ ?
...
I am using a the standard PHP functions imagecopytruecolor and imagejpeg
to rescale and produce uploaded images from a standard HTML form. The images appear at the correct size however the image filesize is quite high (e.g. 540px * 350px = 250kb)
When compared to Photoshop's Save for Web using JPEG high quality settings the same files ...
Is there any encryption and decryption Algorithms that work for both php and c#? Please I need a sample codes
...
I am storing network share paths in my table in MySQL. but some entries got corrupted, i.e they dont have any backslashes in between. Path is like a big word.
I wrote a small script in PHP to update these paths to try and add slashes. It does not give me any error when I run it but the results are not getting updated in the table.
Curr...
hi all, is it possible to design a multibranch web-based system and using the web(internet) as ur platform?
what i mean is that it wont be necessary to have a specialized WAN for the company, but just use a high speed intenet connection?
thnx,
...
I have a simple wordpress website but the customer wants a vbulletin forum with the same look into the website. the same look is just a matter of editing the css files and layout files. but how can i put the vbulletin into a wordpress page?
...
Hi,
I'm using Apache/PHP to support shorlinks to documents and I'm having trouble with the Regex to redirect correctly.
My links take the form of 8 letters/numbers, something like '1abc45fd', I would like to have them redirect to /shortlink.php?link=1abc45fd but it's just not working correctly. I'm using the following expression: "Rewr...
Can anyone recommend the best practice for storing general site preferences? For example, the default page title if the script doesn't set one, or the number of featured items to display in a content box, or a list of thumbnail sizes that the system should make when a picture is uploaded. Centralizing these values has the obvious benefit...
How does one select the first sibling of a xml node with all its child nodes and apply some transformations on it? So far I only succeeded in selected either the first sibling and only the first sibling (no child nodes that is) or everything following the xml node.
Say we have xhtml like this:
<div class="chapter">Chapter <span class="...