I'm currently rewriting an e-shop - but only the client side, i.e. the CMS remains mostly in tact. I am not using a pre-built framework, as the system has to retain backwards compatibility with the CMS and I have to have full freedom of the structure of code.
The new system is purely MVC based and I have a Bootstrapper which loads cont...
I have a file as "documentRoot/app/webroot/myFile.php"
I need to be able to access this file at "mySite/myFile.xml" ie when i type myFile.xml a call should goto "documentRoot/app/webroot/myFile.php"
How can i do this by using .htaccess file??
...
If have a piece of code that gets some data from a sql database
$comms = $row['comments'] ;
if ($comms != "") {
$tooltip = "<b>Notes :</b> $comms </br> ";
}
What i want to do is display the result ONLY if there is something in the data. I am using the if statement to determine if $comms has any data in it but everything i try ...
I would like to get the HTML code from a page with PHP. So I do this:
$url = 'http://en.wikipedia.org/wiki/New_York_City';
$html = file_get_html($url);
The problem is, Wikipedia doesn't send the <script> tag to the PHP request, so it doesn't show the JavaScript.
I guess that's because Wikipedia sees that the "requester" doesn't have J...
Anyone know a PHP scripts that done a good compression for jQuery?
...
I am using "solr" search engine to query an index for classifieds that match a given criteria. The results are the ID:numbers of the classifieds, which I then use to find all matches in a MySql database with those ID:s.
The ID:s returned are put into an array.
As you can see below the array is imploded.
Then I use the "IN" to find all m...
When I moved my sites to a dedicated server from HostGator, several things were broken and all are broken involving type coercion. If $_POST['var'] is 0, it is not considered to be an integer and fails a comparison with another integer.
I went through and forced int types on all of those broken places on the site I found, but I'm sure ...
Hi,
I'm trying to implement full page static caching in my Zend Framework application. Using the Static backend coupled with the Capture frontend, whole pages can be cached, and served by a .htaccess redirect in the future, until the cache is deleted/regenerated. For reference, I've been using the section on Zend_Cache_Backend_Static in...
How to disable filtering in Zend_Form before its re-populating?
...
I have an array in the format:
array (
'1' => array (
'id' => '2',
'qty' => '4'
),
'2' => array (
'id' => '1',
'qty' => '1'
),
'3' => array (
'id' => '2',
'qty' => '3'
),
'4' => array (
'id' => '4',
'qty' => '6'
)
);
And want to find all duplicates of the column '...
Before moving to PDO, I created SQL queries in PHP by concatenating strings. If I got database syntax error, I could just echo the final SQL query string, try it myself on the database, and tweak it until I fixed the error, then put that back into the code.
Prepared PDO statements are faster and better and safer, but one thing bothers m...
Hi! I have started to try out noSQL databases now and are currently testing out couchDB. Seems like a good solution, but I really get some headache when I follow available examples on how to create views (queries) to select documents from a database and sort them.
Everything I can find is regarding JavaScript and it would be great to ta...
Is it possible to show <?php and ?> tags in BBCode? I know about the [code] and [php] tags, but these still strip out any code blocks that contain things like:
<?php echo "myvalue" ?>
Thanks for any ideas.
...
Say you have a website for users to search for "hotel rooms for rent".
I don't know how the logics of current systems work, which is why I am asking you guys.
I currently have two fields in the form:
Date available from: //example 2010-04-01 // 1st april 2010
Date available to: //example 2010-05-01 // 1st may 2010
Then Submit!...
Or the call to real_escape_string() in such cases is not needed?
/Email value comes from user input./
function findUser($email)
{
$mysqli = connectDB();
$email = $mysqli->real_escape_string($email);
$query = "CALL FindUser('{$email}')";
// ...
}
...
Hello all,
Consider the following :
$img_pathm = JURI::root().'images/properties/images/'.$this->datos->id.'/';
$peque_path = JURI::root().'images/properties/images/thumbs/'.$this->datos->id.'/';
$result = count($this->Images);
$resultf = $result-1;
while ($resultf>=0){ ?>
<span class="editlinktip hasTip" title="<?php echo $this->da...
Hey everybody,
In my web application, I have users input a date in a simple textbox. That input (after being sanitized, of course), is run through strtotime(), and 86399 is added to it, to make that timestamp the end of the day written (11:59:59). This is for due date purposes (so if the date passes, the application raises a flag)
For ...
Hi all,
I have a load of php templates which uses a custom translate function "__", i.e.
<?php echo __("Hello"); ?>
I need to write a script which will look for all these function calls (there are about 200 templates).
I.e. it will find __("Hello") and add it to a sentences to be translated array. For example it will find:
$senten...
This is a lot more complicated than it might seem at first. What I have is a giant array which consists of more arrays which contain points [in the form of an array "x,y"] like so:
Array (
[0] => Array (
[0] => "0,9",
[1] => "0,0",
[2] => "9,0",
[3] => "9,9",
[4] => "0,9"
)
[1] => ...
Hi,
I have this class that have a function to load other classes and create instances.
if you used this class like this:
$test = new test();
$test->load("email");
it works perfectly as expected
but when using session_start();
$test = new test();
session_start();
$test->load("email");
an error is created and nothing else is ...