I made a number of html forms containing only radio buttons and a submit button. However, I cannot get them to validate properly–independently of each other. Here is my code: PHP/HTML code for the form: Here is the javascript/jquery I have been trying, but has not worked: When I do this, it always think…
MySQL – Best way to store currency symbols?
Just wondering what the best way of storing currency values and symbols within a MySQL DB might be? Thanks to browsing SO, I’m storing my amounts as a Decimal (19,2) value – which is fine – but am …
Streaming a large file using PHP
I have a 200MB file that I want to give to a user via download. However, since we want the user to only download this file once, we are doing this: echo file_get_contents(‘http://some.secret.location….
Adding to the $PATH environment variable in a PHP script
I have a PHP script that is using wget to download some images. However, wget was installed using Homebrew so it’s not available to the user running the PHP script. When I run exec(‘echo $PATH’) I don’…
Can you call JavaScript function from PHP loop?
I am wounding if I can do this, as I am trying this from last 2 days but no success. I want to run JavaScript function from PHP PHP example JavaScript I am trying to generate a page which print loop number one by one. But I got error jfun is not defined. What I can understand my JavaScript function
Converting BMP to JPG in PHP
In a site I’m developing I need to be able to pass all my images through imagejpeg(), so I decided (as my site only accepts JPG, BMP + PNG uploads) to simply convert BMPs and PNGs to a JPG first. Now to convert the BMP I used the script found here: http://forums.codewalkers.com/php-coding-7/how-to-conve…
Php.ini production vs development
I’m using XAMPP to develop on my localhost. I would like to remove the PHP notices and keep only the warnings. I know this is done through the php.ini file, however I’m having trouble locating it. I followed the path in phpinfo() and it led me to /xampp/php. Inside this folder are two php.ini file…
Should I use echo or print in php scripts?
Which statement should I use in php scripts? Echo or Print? What is faster and mostly used? Thanks in advance.
php form action php self
I have a php form like this. In form action I want to use page name with parameters. like house.php?p_id=10111 . But $_SERVER[‘PHP_SELF’] gives only the house.php (My page full url is house.php?p_id=10111 like this) Please help me to solve this problem. thanks. Answer How about leaving it empty, w…
Disable Garbage Collection
How do I disable garbage collection for a long running php cli script? I am handling unsetting of variables in the script. Answer Unsetting variables does not free memory! It just removes the reference from the variable to the corresponding value. Once any value have a ref-count of 0 the GC collects the value…