I have an config.php file where I simply make an huge array that contains all the framework configuration. Also the database source string thing like "mysql:host=localhost;dbname=mydb" (whats that called, btw?) and username + password for DB. I'm afraid this is:
stupid
not good; better solution there
not secure (?)
so how do the PHP ...
Hi! First timer to the site, not an overly experienced php programmer here :)
I have a problem, i am using an iframe within a site which im attempting to use a session variable inside, firstly ive just been trying to display the session variable to make sure they are accessible from within the iframe:
echo "session of productcheck...
Hi,
There is a problem. I don't want that people would be able to refresh one page on my site. How can I do it?
...
hey this is my user registration form (register_hirer.php) but its not working. its giving a parse error on line after: if (isset($_POST['submit']) which is just has a {.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>The Freelance World</title>
<meta http-equiv="Content-Type" content="text/html; c...
I know many will call this micro optimizing, yes it is that but it is also good to know things like this. Now my question, in my first example below you will see I have a variable set that contains a mysql query then I have another line that runs a function with the above variables mysql query. In my 2nd example I do it all in 1 line, ...
T_PAAMAYIM_NEKUDOTAYIM sounds really exotic, but most certainly absolutely nonsense to me. I traced it all down to this lines of code:
<?php
Class Context {
protected $config;
public function getConfig($key) { // Here's the problem somewhere...
$cnf = $this->config;
return $cnf::getConfig($key);
}
function __co...
I am trying to integrate facebook connect with nmy social network site, currently users create and login with there own account on my site but I am wanting to allow users to basicly create a new account on my site but use the facebook connect to login, I think it will be pretty easy on my site the way I have my user database setup, I hav...
Hello,
I am attempting a basic recursion to create multi-dimensional arrays based on the values of an inputed array.
The recursion works by checking for a value we shall call it "recursion" to start the loop and looks for another value we'll call it "stop_recursion" to end.
Basically taking this array
array('One', 'Two', 'recursion',...
A user logs into a Facebook session in my iPhone app, and then I call a PHP page on my server that needs to use that session to access the user's Facebook account. Is it possible to start the session in the PHP page and be authenticated automatically? Perhaps by passing in the session key and secret from the iPhone app?
...
I am searching for any crypto library that provides SHA-512 hash. Googling around I found some but SHA-512 is absent.
Please suggest.
...
Example: I'm checking for the existence of an array element like this:
if (!self::$instances[$instanceKey]) {
$instances[$instanceKey] = $theInstance;
}
However, I keep getting this error:
Notice: Undefined index: test in /Applications/MAMP/htdocs/mysite/MyClass.php on line 16
Of course, the first time I want an instance, $inst...
I encountered this error when I attempted to insert something into a MySQL table. What's the possible reason? How to solve this problem?
The raw value of "budget" is 800元, when inserted, it became 800, 元 is missing.
...
I need to retrieve a small amount of data from a very large remote XML file that I access via http. I only need a portion of the file at the beginning, but the files I am accessing can often be so large that downloading them all will cause a timeout. It seems like it should be possible with fsockopen to pull only as much as needed befo...
I'm working on a project which needs to be Unicode aware. PHP provides bunch of useful functions like str_count_words() to calculate the number of words in some input, but they won't work against UTF-8 data in PHP < 6 which is a shame. The same applies to strlen(), strrev(), etc.
What should I do about this? PHP 6 is still not even out ...
Is it safe to store sensitive data inside a session variable? Or can it be modified by the client?
...
Example:
// assume PDO instance here: $dbh
function beginTransaction() {
global $dbh;
$dbh->beginTransaction();
}
beginTransaction(); // no typo! called the function above!
$dbh->exec($sql1); // assume $sql1 is there
$dbh->exec($sql2); // assume $sql2 is there
$dbh->commit();
What I try to ask: Must a transaction be started ...
How can i get All my followers with one request?
If i do $this->twitter->getFollowers();
I just get 100 of my followers;
An here is the code for getting followers
/**
* Returns the authenticating user's followers.
*
* @return array
* @param string[optional] $id The id or screen name of the user for whom to request...
I have an HTML table that contains 500 e-mail addresses in this file.html.
Now I want to open it with PHP and get all e-mail addresses in it and add it to an array.
This means I have an HTML table and in this table 500 rows with an e-mail address in each row.
How can I get these e-mail addresses with PHP?
...
I wonder what patterns are there for handling errors in PHP?
I'm close to just make an global ErrorManager object which has methods to add messages. As my entire app gets compiled, any occuring error is logged to that ErrorManager object. At the end of my Front Controller (the last few lines of the script) I tell the ErrorManager to dis...
Hi. I'm trying to make a small script for my site where the user would go to the page, lets say, http://example.com/test.php?p=22. From there, a script would read the 'p' variable, and result with a hyperlink going to http://example.com/diffdir/22.exe. So far, this is what I have coded:
<?php
$test = $HTTP_GET_VARS['p'];
?>
<a href="...