I am a n00b at php. I was learning about Default Parameters so I made this function. function doFoo($name = “johnny”){ echo “Hello $name” . ““; } I made these calls doFoo(); doFoo(“…
Tag: php
access codeigniter session values from external files
In my codeigniter project i have added KCK finder. it needs some of session values which is controlled by codeigniter. how can i access CI session values from external files ?
PHP MSSQL Server connection issue
I have a database of MSSQL server 2005. I can connect to the server via MSSLQL client software (MSSQL Management Studio). The issue is I cant connect to the server from PHP script using the same …
How to get the domain of a specific cookie?
There is a web site www.example.com All cookies are set to the www subdomain. Now there is a new subdomain and I want the cookies to be seen for all subdomains. The goal is to rewrite the www….
Multiple inputs with same name through POST in php
Is it possible to get multiple inputs of the same name to post and then access them from PHP? The idea is this: I have a form that allows the entry of an indefinite number of physical addresses along with other information. If I simply gave each of those fields the same name across several entries and submitt…
How do I initialize a PHP variable?
I am fairly new to PHP (less than a year), and to improve my development environment, I recently started using NetBeans IDE. A warning keeps popping up everywhere stating that “Variable might not have been initialized”. I’ll give an example of a variable that results in this hint/warning: My…
How to debug save_post actions in WordPress?
I have some custom post meta being generated and am ready to add to a post’s meta. I know how to do this. However, save_post causes a redirection after POST data has been sent. This means I am redirected to the dashboard and lose access to my POST data – therefore I cannot debug easily. Currently …
How do I install GD on my windows server version of PHP
I am running Windows Server 2003 and need to install a version of GD. Can anyone point out some instructions or advice? Answer Check php_gd2.dll is in your extension directory and uncomment ;extension=php_gd2.dll of your php.ini.
CodeIgniter – how to catch DB errors?
Is there a way to make CI throw an exception when it encounters a DB error instead of displaying a message like: A Database Error Occurred Error Number: 1054 Unknown column ‘foo’ in ‘…
PHP to Javascript Arrays and GPS locations
I’m making a script that will hopefully be mainly PHP so it doesn’t require Javascript later on, but right now I’m stuck on a few things. What is the best way to store GPS locations, and then compare them? I could use to store them in a database (currently using MySQL), and then find people …