I have a SolrPhpClient on my classifieds website, and whenever users wants to add/remove classified the index in Solr gets updated via Php code.
So I wonder, does this mean that my Solr index is open for anybody to alter with?
Same Q applies to the Solr Admin page.
If I set a password for the admin page, does this mean that my classifi...
I am working through an older php mysql book written in 2003. The author uses the include() function to construct html pages by including header.inc, footer.inc, main.inc files, etc. Now I find out that this is not allowed in the default ini settings, (allow_url_include is set to Off) after I got many warnings from the server.
I noticed...
What I'd like is for this class
class Car {
public function __construct(Engine $engine, Make $make, Model $model)
{
// stuff
}
}
Get an array that has the types needed to construct this car (Engine, Make, Model) in the order they are needed for the constructor. I'm using this for a Dependency Injection-esque thin...
Hi,
How do I do this on a php webpage?
I want to get and decode a json string and display the results as html on my page, however, I don't want it hotlinking back to the source.
If I could write the decoded string to a txt file say weather.txt on the server and keep the html formatting and do it so that the page won't fetch the json...
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1JREFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jqch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0vr4MkhoXe0rZigAAAABJRU5ErkJggg==
T...
When the user clicks a logout button, I connect to a script that simply does this
session_destroy();
session_start();
I thought this would be enough to reset all $_SESSION variables such as $_SESSION['logged'] and $_SESSION['username'] but when I load the page again, it automatically logs me in as if the session is still active.
...
The snippet below loops through some web pages, grabs the html and then looks for table.results and gets the plaintext out of the tags contained in each . $result is ok.
Now I'm trying to get the href value of an tag that is found in the second of each . I'd like to include this in the $results array, but I'm not sure how to do this....
Hi, I have a piece of code that fetches data by giving it an ID. If I give it an ID of 1230 for example, the code fetches an article data with an ID of 1230 from a web site (external) and insert it into a DB.
Now, the problem is that I need to fetch all the articles, lets say from ID 00001 to 99999.
If a do a 'for' loop, after 60 second...
You have a web page with a form that has an input field of type file. You have another web page that expects the data from the first page.
In the second page you need to check whether a file has been sent.
How do you do that?
I've been using the following statement but I'm not sure about it:
$_FILES["file"]["tmp_name"] == ""
...
Would setting the $link to my database be one thing that I should use a GLOBAL scope for? In my setting of (lots of functions)...it seems as though having only one variable that is in the global scope would be wise.
I am currently using the functions to transfer it back and forth so that way I do not have it in the global scope. But it...
Some of the testing I will need to do will require comparing a known array with the result I am getting from the functions I will be running.
For comparing arrays recursively:
Does PHPUnit have an inbuilt function?
Does someone here have some code they have constructed to share?
Will this be something I will have to construct on my ...
This prints apple:
define("CONSTANT","apple");
echo CONSTANT;
But this doesn't:
echo "This is a constant: CONSTANT";
Why?
...
Hey guys, if anybody can help me out i'd love it...
What i have is a form, that went sent, uses doublecheck.php
<?php
require_once('recaptchalib.php');
$privatekey = "";
$resp = recaptcha_check_answer ($privatekey,
$_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"],
$_POST["recaptcha_r...
I've started developing a forum application in PHP on my MVC Framework and I've got to the stage where I assign permissions to members (for example: READ, WRITE, UPDATE, DELETE).
Now, I know I can add 5 columns under the user table in my database and set them to 1 | 0, but that to me seems like too much if I want to add other rules, l...
When I use some of php's encryption functions, I end up getting a few characters I don't want (+, /, =). The problem is that my application doesn't allow these in the url. I'm wondering if there's a good way of encrypting an integer and having only alphanumeric characters in the result? I'm trying to pass some data through the url. I kno...
Hello guys
I would like to know how to compare two two-dimension arrays value.
First array
Array 1
(
[0] => Array
(
[0] => a
)
[1] => Array
(
[0] => b
)
[2] => Array
(
[0] => c
)
}
Second one
Array 2
(
[0] => Array
...
I am working with Zend_Auth and cookie/session persistence. I can't seem to figure out how to force an authentication with this class.
Is there any way to force Zend_Auth to believe it has authenticated as a user?
...
$query = $this->db->query("SELECT t1.numberofbets, t1.profit, t2.seven_profit, t3.28profit, user.user_id, username, password, email, balance, user.date_added, activation_code, activated FROM user LEFT JOIN (SELECT user_id, SUM(amount_won) AS profit, count(tip_id) AS numberofbets FROM tip GROUP BY user_id) as t1 ON user.user_id = t1.user_...
Why might a file only be partially uploaded?
I am improving error-handling in my PHP file upload script and am trying to figure out how to handle UPLOAD_ERR_PARTIAL properly.
Should I prompt the user to try uploading the file again, or should I inform them that there is a more severe problem which is preventing them from uploading a p...