I’m learning Ajax by failure and have hit a wall: I have an array (if it matters, the array is storing number id’s based on what checkboxes the user checks) that is written in Javascript. I have a function that is called when the user clicks the ‘save’ button. The function is as follow…
Tag: php
How to separately validate each simple HTML radio form, created through a PHP loop, using Javascript and Jquery
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 …
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…
How to get the value of a checked Radio Button from jQuery $.post after it is submitted to a PHP file
I am completely new to javascript/jquery, and would appreciate any help. I am having trouble with the function $.post because I am using radio in the form. I need to use the value of the chosen radio in a different file, so that I can process what should be outputted, and then I want to output something in pl…