So, I’m trying to learn PHP and MySQL (I have a basic understanding of both; I’ve read the first half of both Head First SQL and Head First PHP & MySQL) and I figure the best way to solidify my knowledge is by building something rather than reading. With that in mind, I would like to create a basic webpage
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
PHP – Redirect and send data via POST
I have an online gateway which requires an HTML form to be submitted with hidden fields. I need to do this via a PHP script without any HTML forms (I have the data for the hidden fields in a DB) To …
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 can I see what variables are sent from flash to a PHP script?
I was wondering how I could see what variables my flash sends to my PHP script. Is that possible? Maybe an extension or something else? I don’t know if my flash is sending any variables. My problem is that I have a flash which I can’t change and the flash has a form. In that form the variables are sent
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