I've got a series of Post models that hasAndBelongsToMany Media models. In certain function calls inside of the Post model, I don't need to retrieve the entire list of Media models. However, when I use the following code:
$this->unbindModel( array('hasAndBelongsToMany' => array('Media')) );
// Rebind to get only the fields we need:
$t...
Hello,
I am using PHP's DOM object to create HTML pages for my website. This works great for my head, however since I will be entering a lot of HTML into the body (not via DOM). I would think I would need to use DOM->createElement($bodyHTML) to add my HTML from my site to the DOM object, However DON->createElement seems to parse all HTM...
I have a text editor on my web page, on that text editor i put image and than i use that image in different parts of my website, but in different places the image size differs.
The image in database is stored this way: <div><img width="210" height="150" alt="" src="/portali/userfiles/image/Kategorite/Teknologji/-1.jpg" /></div>
Now in...
So I'm working on an application that requires a user to login before accessing any 'sensitive material'.
The login script works like this: User enters U/P->Script validates data->If valid, SESSION variables are set.
This is a very strange problem, since SESSIONS are handled by the server.
The problem: When first opening the script i...
If I have a string of characters like so:
This is a test string and I wa
And I wanted to delete everything after the "I" which would also include the space after the I, how would I do this? I definitely need to start at the end of the string and count backwards to the last space but I'm not sure how to do this.
...
Hello fellow PHPers!
It does not seem like Doctrine 2 has built-in validation. Is this a feature that will be supported in the future? How and where do you validate your Doctrine 2 entities?
Guess I have to write my own validation engine for Doctrine.
thanks
...
Hi all,
I have a current wordpress blog with the blog posts URLs structured as http://somedomain.com/2010/02/postname
I'm now installing a zend framework implementation at the base level http://somedomain.com/
I DON'T want my blog to have a different url structure. like http://somedomain.com/blog/2010/02/article-name
Any ideas on ...
I have a points system setup on my site, where every single point accumulated is logged in the points table. The structure is simple, p_userid, p_points (how many points accumulated during this action), and p_timestamp.
I wanna display top 3 point accumulating users, for each month. So essentially, it should sum the p_points table for...
I hear people talking about dependency injection and the benefit of it all the time, but I don't really understand it.
I'm wondering if it's a solution to the "I pass database connections as arguments all the time" problem.
I tried reading wikipedia's entry on it, but the example is written in Java so I don't solidly understand the dif...
Hi,
I am trying to make some changes to an opensource project. I want to keep track of when users log in and log out.
Right now I change their login status in db when they login or manually log out. The problem right now is that I cannot find out if the user just closed their browser without pressing on logout button.
For this reason ...
I want to give users the option to change their timezone and display their data in that timezone. I'm currently storing a unix timestamp and would like to know what the best way to handle this conversion would be.
I am storing my timestamp in unix format. My concern is what function can I use to do the conversion on the presentation l...
I am using a REST API to POST attributes to a person using json. My request body looks like this:
$requestBody = '
{
"attribute": {
"@id": "",
"@uri": "",
"person": {
"@id": "222",
"@uri": "https://api_name_removed.com/v1/People/222"
},
"attributeGroup": {
...
With powerful frameworks like jQuery, it seems to be possible to build an entire app logic on the client side. It's very much analogous to building a client app as a native program.
Now suppose this client app needs to access a remote database. The usual solution seems to involve the layers Ajax/PHP/MySQL.
It seems to me that the PHP l...
If I enter 'localhost' on my browser, I'm taken to XAMPP's welcome screen so everything is installed correctly.
What folder do I have to put my html files in?
Thanks.
...
Here's my PHP code:
<html>
<Head>
<?php $FirstName="Sergio";
$LastName="Tapia";
$firstNameCount=strlen($Firstname);
?>
</Head>
<body>
<h1>It works!</h1>
<?php echo("Why hello there Mr. ");
echo $FirstName . " " . $LastName;
...
// I am working on matching the individual words from array $frequency
// to the search results from that individual word.
I don't know why this does not work
for ($i = 1; $i <= ($frequency); $i++) {
echo $i;
echo getphp_AlexVortaro ($frequency[$i]);
echo getphp_Smartfm($frequency[$i]);
print_r($frequency[$i]);
...
How do i get all the info, products pics, settings, etc... from one magento install to another?
The backup feature it has don't seem to be that great.
...
I can't explain this. I have the following:
$time += $res['timezone']; (The array equates to -5*3600 (EST))
return gmstrftime('%c',$time);
When I echo $res['timezone'], I get "-5*3600" which is correct. When I put the array value in front of the time variable, I get the incorrect time. If I comment out the array value and re...
I use a the following PHP switch for my navigation menu:
<?php include("header.php");
if (! isset($_GET['page']))
{
include('./home.php');
} else {
$page = $_GET['page'];
switch($page)
{
case 'about':
include('./about.php');
break;
...
How do I get this to pull my 2nd variable? (I already have a switch setup)
<body id="<?php if (! isset($_GET['page'])) { echo "home"; } else { $_GET['page']; echo $page; } ?>">
I have a switch statement that pulls the pages from
index.php?page=#####
and I have just added this part to my switch:
index.php?page=####§ion=#####...