Below is the code of
header.php
This file is included in another file, by
require 'header.php';
.
<?php
if(empty($user))
{
$html=<<<eod
<div class="account"><a href="publish.php">Post Task</a> | <span class="boldfont"> $user</span> | <a href="../common/logout.php">Sign Out</a></div>
eod;
echo...
Hey I have coded CakePHP for a number of things but never ran into this problem before surprisingly. Also I have thoroughly searched the net and CakePHP docs and have not found an answer to my question. My question is, I have a table for my model that should be named Class, obviously I cannot use that name though since it's a reserved PH...
i can never understand how solr works.
it just talks about schema files all the way but how do i import content from the database to it with a painless method?
i have tried to figure it out by reading their tutorials but it just mess up my head.
its written for the Einsteins out there cause apparently there are a lot of people who als...
Hi
I have a very similar setup to the person here:
http://stackoverflow.com/questions/265073/php-background-processes
i.e a very long script that takes up to 10 minutes. However, I need the person who calls the script redirected back to the homepage while the script works. In other words, I need the user experience to be something like ...
Hi all.
I want to create my own personal login gateway into Gmail/Facebook/any other site. In this gateway I enter my master username and password, then I can choose where to login (gmail/facebook/etc) without entering those usernames because they are stored on the server.
I tried to implement this by using cURL to send POST request wi...
Take the following code as an example:
class xpto
{
public function __get($key)
{
return $key;
}
}
function xpto()
{
static $instance = null;
if (is_null($instance) === true)
{
$instance = new xpto();
}
return $instance;
}
echo xpto()->haha; // returns "haha"
Now, I'm trying to archive the...
I need some php library to parse html content to DOM tree
Like this:
html
|--head
| |---title--title_content
| |---meta--meta_content
|--body
| |---div
| | |--div--div_content
.. etc
and also repare or clean the invalid html.
ITS not only for HTML BUT event for any XML style mark-up language.
basically a parent-...
Hi,
I'm pretty used to Django. With Django you define your models for the ORM and it takes care of generating / altering the database itself for storing the data based on the models.
In php i'm looking for a similar solution. Doctrine seems to be the standard php ORM, but, as far as I've seen, you have to write the DB and then attach t...
Hey all, my first post :D
Problem:
I'm trying to make a template gallery, not a slide show, which i can easily reuse on multiple sites.
Mostly for quick folio sites, where the owner wont know how to update the code to add pictures.
It needs to read all of the image files from a selected directory. (jpg, gif, png, bmp)
It needs to be a...
I can currently not use FULLTEXT indexes to search whole words because my server wont allow less characters than 4 in a search string.
I need a workaround then from you guys.
I want to be able to enter 'bmw 330' and then get results from mysql with whole matches like 'bmw 330'.
Should I consider a third party search engine for this?
...
Hi,
I've got an issue with Zend_Captcha always returning false when the page is submitted and the captcha's isValid() method is being called. It's driving my nuts because this as far as I am concerned should work.
I start by declaring this at the top of the action function of the controller
$captcha = new Zend_Captcha_Image('captcha...
I'm using TinyMCE and want to execute a php script get the output and post the output.
I'm trying to insert my code with data pre-populated by a php script.
Can someone help me with this. I'm a JavaScript novice..
This is my code to insert single instances without data. (The rest of the code is straight from the example on the docume...
I am creating a search function of my classifieds on my website.
Here is some of the criteria I need to meet:
When searching for 'bmw 520' only matches where these two words come in exactly this order is returned. not matches for only 'bmw' or only '520'.
When searching for 'bmw 330ci' results as the above will be returned, but, WITH A...
How would I go about taking input html and changing any src or href links that go to a local adress (e.g. href="index.html" to their full location (specified) e.g. href="http://www.somesite.com/index.html") this is for a site that gets a file from another site and displays it (kinda like a proxy)
...
I can't get APC to work on Windows because Apache keeps crashing as soon as I run a php file. Is this issue know and is there a workaround?
Versions:
Apache 2.2.14
PHP 3.1
APC 3.1.3
...
Hello,
I am working on a project which needs to insert the member birthday's into MySQL database. But i am confused. Actually i am using it like that:
int(10)
So i change the format e.g. "27/06/1960" to unix time using PHP and use the function date() to show the birthday. Is there any better solution? and is there any good resource you...
This is what I've got for for my RegEx, I was wondering if this is the best way.
I want to be able to find something similar regardless of the spacing between Identifiers and not be case sensitive. And if possible, not worry about order..
Example:
[Foreclosure ="Remax" URL="http://www.remax.com" Title = "4 Bedroom 2 Bath Condo"]
[F...
Decided to learn PHP, Python. Lots of books are there in market, but donno which are latest/newbie friendly.
Need your help..
...
I'm extracting a string from wikipedia API that initially looks like this:
link text. I want to peel off all {{...}} and everything in between them (could be any kind of text). For that I thought about using a recursive function with "preg_match","preg_replace".
something like:
function drop_brax($text)
{
if(preg_match('/{{(.)*}}/',...
I'm pulling some data with the WPDB class in Wordpress, however - the data is being retrieved as raw data, without any markup.
How can I automatically add this markup?
...