|
I am trying to decide on the best way to store my applications configuration settings. There are so many options.
The majority of applications I have seen have used a simple require and a PHP file that contains variables. There seem to be far more advanced...
Started by Mark on
, 11 posts
by 11 people.
Answer Snippets (Read the full thread at stackoverflow):
Your best bet is ....
It is best to do any core configuration in PHP itself, but if you nowadays on the web.
The best thing you can do is the simplest thing that could possibly work (php variables) and wrap is testable and write unit tests.
|
|
I want to determine if using Apache's .htaccess mod rewrite is a faster way to redirect to a PHP file, compared to redirecting from one PHP file to another, using the header redirect core function of PHP.
I looked around and I was unable to find anything...
Started by thecrandallster on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at serverfault):
If this assumption rule, it will re-route the request to PHP, and site visitor will immediately get the final result using PHP header : request comes ....
With no flags at all or an [L] flag.
A request to a different PHP file - e.g.
|
|
Hello All,
Is there a way to get user-defined php functions, variables, constants from a php file? Following functions are not the best way to do so because they get all decalred functions/vars/constants (with hundreds of php's built-in constants and ...
Started by Sarfraz on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Http://www.php.net/manual/en/ref.tokenizer.php
From an external script:
<?php var_dump(token_get_all(file_get_contents('myscript.php'))); ?>
call.
You probably want to try the PHP Tokenizer.
|
Ask your Facebook Friends
|
Here is a stripped down version of what I use to authenticate users, it works fine on my php v5.0.2/mysql 4.0.21 server, but fails on my php v5.1.6/mysql v5.0.45 server.
In the code below, should I be aware of anything that might not be supported by the...
Started by Brad on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Look into using PHP MySQL escaping ..
Doesn't work, try putting the following snippet right after <?php :
// Enable displaying errors like that.
|
|
Neither
<?php system('/usr/bin/php file.php'); ?>
I tried with -q, with !#/usr/bin/php etc... anyone can help?
Started by barredo on
, 13 posts
by 11 people.
Answer Snippets (Read the full thread at stackoverflow):
It's probably the path to the PHP executable, the path to file.php:
<?php system('/usr/bin/php -f file.php'); ?>
What do you mean by "it doesn't work"?
Did you files a.php && b.php (with all permissions....
Without any more info...
|
|
Xampp 1.7.2 ? how do i swap out PHP 5.3 for PHP 5.2 so i can use joomla 1.5
Started by jskoyles on
, 8 posts
by 8 people.
Answer Snippets (Read the full thread at stackoverflow):
D:\Documents and Settings\box>....
You'll have to uninstall XAMPP 1.7.2 and install XAMPP 1.7.0, which contains PHP 5.2.8.
PHP 5.3 was added in version 1.7.2, so anything older would be good.
You can download older versions of XAMPP here.
|
|
Is PHP on it's own a good enough templating language, or should one use something like Smarty to write PHP templates in?
Started by Jrgns on
, 12 posts
by 12 people.
Answer Snippets (Read the full thread at stackoverflow):
I work by the "conditionals and loops"....
Don't forget that PHP's original purpose was to be a templating language.
I'd to bite you.
Just look at most JSP templates (or template-less PHP code, for that matter).
On" in the template grows.
|
|
PHP 5.2.8 is refusing to load php_pgsql.dll , with the following error:
Warning: PHP Startup: Unable to load dynamic library 'D:\PHP\ext\php_pgsql.dll' - The specified module could not be found.
in Unknown on line 0
The .dll exists in PHP/ext/.
Has anyone...
Started by Ross on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
The problem is with the related libraries used by php_....
Edit: or, the permissions on the file were set incorrectly .
Make sure your version is definitely the one compiled against PHP 5.2.8.
Version of PHP to the one I was running.
|
|
I am templatizing my php.ini using PHP. I have a script to set up a development environment by generating httpd.conf, apachectl, and php.ini from templates using a CLI PHP script. Unfortunately there are literal <? and <?php strings in php.ini (...
Started by nohat on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
You are asking how you can embed interpreted <....
This:
<?php echo "<?php"; ?>
Will output:
<?php
A quick & simple solution would parsed, simply replace those unique markers back with the corresponding php tag.
|
|
How to access PHP varibles in Javascript or Jquery? Do I have to write
<?php echo $variable1 ?> <?php echo $variable2 ?> <?php echo $variable3 ?> ... <?php echo $variablen ?>
I know I can store some variables in cookies,and access...
Started by Steven on
, 6 posts
by 6 people.
Answer Snippets (Read the full thread at stackoverflow):
You can....
If PHP is configured also of course use a database.
As far as syntax (I think since PHP4?) you can use:
<?=$var?>
.. .
You write alert('<?php echo($phpvariable); ?>');
There are sure other ways question.
Basically, yes.
|