Skip to content
Advertisement

Tag: forms

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, what is wrong with that? Also, you can omit the action

PHP: Possible to automatically get all POSTed data?

Simple question: Is it possible to get all the data POSTed to a page, even if you don’t know all the fields? For example, I want to write a simple script that collects any POSTed data and emails it. I can foresee that the fields in the form are likely to change a lot over time, and so to save

how to check if PHP variable contains non-numbers?

I just want to know the method to check a PHP variable for any non-numbers and if it also detects spaces between characters? Need to make sure nothing weird gets put into my form fields. Thanks in advance. Answer If you mean that you only want a value to contain digits then you can use ctype_digit().

PHP – Uploading multiple files

I’m working on a plugin for wordpress and I want to be able to upload multiple pictures from a form. Right now when I have a form for two pictures and submit it empty, my $_FILES array looks like this: Now the problem is that I want to use wordpress’ upload handler, wp_handle_upload. It expects the $_FILES array as an

Get value of input box, without a form?

Does anyone know how I can get the value of an input box, without having a form? I want a submit button, but instead of submitting a form, I want it to change data in a MySQL database. Something like this maybe? Could I use that code on a “onclick” event? The input box’s name and id is “img1”. Answer

How to access the form’s ‘name’ variable from PHP

I’m trying to create a BMI calculator. This should allow people to use either metric or imperial measurements. I realise that I could use hidden tags to solve my problem, but this has bugged me before so I thought I’d ask: I can use $_POST[‘variableName’] to find the submitted variableName field-value; but…I don’t know, or see, how to verify which

Advertisement