I wonder if there any better ideas to solve the problem below, I have a form with a number of input fields, such as, But sometimes don’t need certain input fields above in my form, for instance, I only need the page title for my db injection, And I have another php page to handle the $_POST data, Every …
Tag: php
How to create an empty array in PHP with predefined size?
I am creating a new array in a for loop. PHP keeps complaining about the offset since for each iteration I add a new index for the array, which is kind of stupid. Is there some way to predefine the number items in the array so that PHP will not show this notice? In other words, can I predefine the
PHP Fatal Error Failed opening required File
I am getting the following error from Apache [Sat Mar 19 23:10:50 2011] [warn] mod_fcgid: stderr: PHP Fatal error: require_once() [function.require]: Failed opening required ‘/common/configs/config_templates.inc.php’ (include_path=’.:/usr/share/pear:/usr/share/php’) in /home/viapics1/p…
Looping through JSON Data
There is probably a simple response to this, but I’ve scoured the net trying to find an answer. Imagine the following JSON data ($json): What I’d like to do is loop through the data contained within Mid3, so that I can display Bottom1, Bottom2, etc.. so I thought this would work: Does anyone know …
php delete a single file in directory
I’ve got the php list directory script from this link http://www.gaijin.at/en/scrphpfilelist.php. How do I delete a single file from the directoy? I tried unlink, but it deleted all the files from that directory. this the short code what i got from the link! the list directory folder call : backup. in t…
PHP Warning: Unknown: failed to open stream
I edited the apache httpd.conf file recently for the mod_rewrite to work. I don’t know if this problem originated from that or not, but i’m getting this problem from that day. This is what I see on the frontend when I run the software – Server error The website encountered an error while ret…
executing a Powershell script from php
I’m trying to execute a powershell script from PHP, but it does not seem to work. The script ‘newEvent.ps1’ creates an event on the Exchange server. It outputs: If I run powershell.exe C:wampwwwantassetspsnewEvent.ps1 on the command-line, it works fine. This is the first time im attempting s…
in_array for a combo value (‘test’,’value’)
I’m trying to use in_array or something like it for associative or more complex arrays. This is the normal in_array What I’m trying to search is a pair, like the combination ‘test’ and ‘value’. I can set up the combo to be searched to array(‘test’,’value&#…
How to change sql_mode at runtime
My MySQL server’s sql_mode setting is set to STRICT. I want to change it to TRADITIONAL for a particular application I’m developing. However it’s not possible for me to do this at the server level. …
Update Command-line Output, i.e. for Progress
I’d like to be able to show a progress meter in a simple PHP script on the command line. Instead of seeing Progress: 0% Progress: 1% etc… I’d like just the number to change, and replace the …