Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




How To Get A Dynamic Javacript Form Variables Seperated In PHP


PROBLEM: I have this form that allows the user to dynamically create
additional fields (see javascript code bellow). I am trying to retrieve
the values entered into these fields from my php script. I ultimatly
need to pick out the variables and place the values into my php script
page. I have worked with a little code I found on php.net (see php code
below), but I wan unable to grasp the knowledge on how to seperate the
variables in the address bar. Please reply.

QUESTION: How do I create variables in my php script from my dynamic
javascript form?

PHP CODE:
foreach($_GET as $name => $value) {
print "$name : $value<br>";
}

JAVASCRIPT CODE:
<HEAD>
<!-- Begin
function createForm(number) {
data = "";
inter = "'";
if (number < 16 && number > -1) {
for (i=1; i <= number; i++) {
if (i < 10) spaces=" ";
else spaces=" ";
data = data + "URL " + i + " :" + spaces
+ "<input type='text' size=10 name=" + inter
+ "url" + i + inter + "'><br>";
}
if (document.layers) {
document.layers.cust.document.write(data);
document.layers.cust.document.close();
}
else {
if (document.all) {
cust.innerHTML = data;
}
}
}
else {
window.alert("Please select up to 15 entries.");
}
}




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Breaking Up A Comma Seperated List
i have a list seperated by commas: 1. 3. 5. 7. 9 actually is a varible

$members ="1, 3, 5, 7, 9"; what would be the best way to break that up to insert the values into a table in a loop.

Comma Seperated List Comparison
is it possible to compare acomma separated list aginst another

eg comma list 1 => 1,2,3,4,5
comma list 2 => 3,5
can you check that 3 is in both, and 5 is in both, therfore they match?

the comparison is to check that if product a who supplies products 1,2,3,4,5
can be used instead of product b who supplies 3,5 as product a already
supplies them

Seperate Links From Comma Seperated Value In A Databse
I have a value which is $keywords in my database The key words are separated by commas, like:  fun, funny, exciting, weird I want to make each of those keywords link to "link.php" I can only get them all to be one link, how would I make them each into seperate links.

Dynamic Form Fields/multiple Page Form?
It is for a friends out of print booksite, where visitors can request multiple books to be searched by adding one at a time to a cart (javascript), then once all added they submit to another form where they enter their personal details and all is sent through. The problem is at the moment they cannot change whats in the cart without refreshing the browser window and losing everything.

1) present for asking how many books they want to search for
2) display multiple rows of the same input fields depending on how many books they say they want to have searched for?i.e

title|author|publisher|etc
title|author|publisher|etc
title|author|publisher|etc

3) when these are submitted they could see these above the next part of the form where they enter their details with the option to go back and delete/amend.
4) send all the info to my colleague.

if so has anyone seen a similar script that I could take a look @ to see if I can hack it to suit my needs?

Dynamic Variables In Php?
Hi,
I have a mySQL table that contains two columns
column one is 'feature' and column two is 'feature_value' - some of the data is for example

'hair_color' - 'blue'
'hair_color' - 'blonde'
'hair_color' - 'black'
'hair_color' - 'gray'

'eye_color' - 'blue'
'eye_color' - 'hazel'
'eye_color' - 'brown'

Yeah I know... definitely NOT third normal form. OK here's where it gets even better

On one web page, I build select controls from this data. The name of the control would be the value of the feature column. So from the data above I would have a select control whose name would be name="hair_color" and another select name="eye_color"

NO problems so far.... ok.
Now after the user selects from the selects (get it, sorry).... i am processing the data.

Although I use javascript for some client side validation... I also want to validate in php. (ok, just because I want to ok)

NOW.. the web page form will post these two variables $hair_color' and '$eye_color' as described above. But I don't know ahead of time what these variables are because they're based on data from a table.......

I go the table described above and select distinct on the feature column - I will return two rows.... see below

while($row = mysql_fetch_row($result_set)) {
$feature =trim($row[0]);
}

the value of feature in the first row is 'hair_color' and in the second row 'eye_color'--


What I'd like to do.... is to take the values in the $feature variable and create a literal variable that I can test for that was posted from the form........

so for example in the first row where $feature = 'hair_color' - I want to create a $hair_color variable...... because this is a variable of the select control from the form. Then for the second row where $feature = 'eye_color' - I want to create an $eye_color variable because again... this is the variable of a select control on the form.

Dynamic Variables
I am NEWBIE & trying to develop internal control system with PHP-MySql & have one problem.

I want to enter dynamic variable into MySql like :

"I have checked report of Mr. $userName from $previousDate to $currentDate…..”

Wherein - $username, $previousDate, $currentDate will be called from other table.

My codes :

PHP Code:

INSERT INTO `checkReport ` (`schID`, `schNo`, `noteNo`, `subschName`, `content`) VALUES (1, 1, 'a', '', ' I have checked report of Mr. ‘.$username.’ from ‘.$previousDate.’ to ‘.$currentDate.’ ….)

which is not working… Please guide me through.

Dynamic Variables
I know there's a way to have variables be created dynamically. What I'm trying to do is to pass information about products to PayPal, but I don't know how many products are going to be in each cart.  It could be 1 or 100. I need to create a variable who's ending number changes depending on how many products are in the cart. How do you have those created dynamically?  I need the information to be passed through hidden variables via an HTML form as well.

Dynamic Variables Within A LOOP
Ok, problem, running through this loop to upload a thumb and large image of origonal one provided, and to generate names for the database for each upload.

The problem is it wont assign the name for the second and third itteration properly, instead of being the VALUE its the name of the DYNAMIC VARIABLE, all files are uploaded correctly, all other entries in the database are fine including the first picture name, it just fails to work on the last two loops of the for statement.

CODE (Sorry for the mess) :

Creating Dynamic Variables
I'm trying to pass 100 variables (named gain1, gain2...gain100) from a swf to a php file then write these variables to a text file.  Sending the data works fine. 

I just need help creating the variables in the php file.  Since all the files have partly the same name, I was hoping to create the variables dynamically.  I was hoping to do something like this:

$myFileName = "myfile.txt";
$myFileHandle = fopen($myFileName, 'a') or die("can't open file");

for (i=1; i<100; i++) {
$gaintext + i= $_POST['gaintxt1' + i];
fwrite($myFileHandle, $gain + i);}

However, this isn't working obviously. 

Dynamic Declaration Of Class Variables?
I have a mysql table, but because there are lots of fields, I want to create automatically variables in the class, taking their names from fields' names.

I know how to do it outside a class, but in a class you have to declare the variables before use them. So I can't figure out how to dynamic declare variables through code inside the class. Any idea? Or is it possible?

Dynamic Form
I have one user table in my MySQL database and this is linked to a user type table containing 3 types of user. Each type of user will be required to give a different amount of data when registering.

Basically I want to create one registration form for all types of users but only show the form fields that are relevant to the individual user type. The user type will be selected from a pervious page containing a list menu with the 3 user types that is sent via GET to the registration page.

Dynamic Form
I need to create a form that takes a number that the user enters, and
duplicates a question the number of times the user entered. For
instance, if the customer enters 5 on the first page, when they press
next the form generates "How old are you?" 5 times on the page. The
customer will answer all 5 questions then press next. Finally, all the
local variables get dynamically created and written to a database.

I have already taken care of dynamically creating the question five
times. Using a simple WHILE clause, this generates the correct number
of questions. What I am having an issue with at this point, is how to
dynamically create the local variables.For instance, for the question
"How old are you?" I would need a unique variable for each instance;
using something like $Age(n). So that for five times, it would
automatically created variables $Age1 through $Age5. I have carried
over the number to the submit page by creating the variable $Number
and passing it along as hidden button on the form. $Age'$Number'
seemed to work for creating the variable, but $_post["Age'$Number'"]
doesn't work for referencing the global variable. I would need some
way of looping through and dynamically creating the variables.

Dynamic Form
I had to make a form for someone, with 42 questions each question had different form-elements. I was typing and coding for almost 3 hours..!! lets say we would make a form (formmaker.php) to dynamicly create a form with multiple questions: on the formmaker :

-first we have to enter the number of questions (max 100)
-then we have to type the question(s) in (an) input field(s)
-then we would have to select a type of answering field (textbox, checkbox, radiobuttons, file, dropdown etc. )

-it would be nice if we could select to make the question mandatory or not.
-if we choose for checkboxes or radiobuttons , it would be nice to know how much of them (no limits here !) ok..limit it to 30

-when we have selected...for example..15 checkboxes, they have to dynamicly appear on the formmaker.
-for each checkbox or radiobutton, we have to enter a value.
-finaly we have to add an email adres to each question !!! (and a BCC field) (this way, we can use one form and split and send the data to multiple recipients..!!)

-also we have to be able to dissable or enable a question. (if dissabled, it wont show on the created form..

A nice template to show a filled in form is preferable.. It would be nice to store everything in a database tabel. (for each new form a new tabel in the database) question1 id active(yes/no) questiontext fieldtype mandatory(yes/no) radio_or_checkboxvalue1(rocv1) rocv2 rocv3 rocv4 rocv5 etc.... sendto_email bcc_email
I started with the code already...here it is: Code:

Dynamic Form Value Modification
I was wondering if and then how to dynamically update form variables without having move between webpages

I am developing a print quoting system for a company and I want the options in list boxes to adapt based on the values of previous selection in the form. However it must happen immediatly without the whole page having to refresh.

For example if a person chooses paper size to be A4 then the next drop down list must only have options available for A4 pages.

I thought I would need to use Javascript for this but I can't find out how to access the server side mysql database so I get the feeling Javascript is the wrong option.

The whole site is programmed in php but php is server side so I don't don't think its possible using php specifically.

Dynamic Form Selects
How do you make dynamic for selects in php? It is in regards to a modify type scripts im writing in php/mysql.

So regular select drop downs look like so:

<select name=genericselect>
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>

right, well if I was pulling info from a database, how would I make is so that the 'selected' value is dynamic and comes from the database? Im sure theres a simple way of doing this.

Getting Info Out Of Dynamic Form
I am using the following code to produce a dynamic form.

$result = mysql_query("SELECT id,weight,date FROM weekly_data WHERE
weight IS NULL AND subscr_id = '$toss' AND date <= now()");
if (!$result) {
die('Invalid query: ' . mysql_error());
}
print"<table width=ï`%' id='catchup' border=&#390;' cellspacing=&#390;'
cellpadding=&#390;'>";
print "<form name='form1' id='form1' method='post'
action='catchupprocess.php'>";
print"<tr>";
print"<td></td>";
print"<td>Weight</td>";
print"<td>Date</td>";
print"<td>Waist</td>";
print"<td>Measure</td>";
print"<td></td>";
print"</tr>";
while ($row = mysql_fetch_array ($result)){
//echo $result;
print"<tr>";
print"<td>";
print"<input name='".$row['id']."' size=&#394;' type='text'
value='".$row['id']."'/>";
print"</td><td>";
print"<input type='text' size=&#396;' name='weight".$row['id']."'
value=''/>";
print"</td><td>";
print"<input type='text' size=&#3910;' value='".$row['date']."'/>";
print"</td><td>";
print"<input type='text' size=&#393;' name='waist".$row['id']."'
value=''/>";
print"</td><td>";
print"<input type='text' size=&#396;' value='$measure'/>";
print"</td><td>";
print"<input type='hidden' size=&#3910;' value=''/>";
print"</td>";
print"</tr>";
}
print"<tr>";
print"<td>&nbsp;</td>";
print"<td><input name='Reset' type='reset' value='Reset'></td>";
print"<td>&nbsp;</td>";
print"<td><input name='submitcatchup' type='submit'
value='Submit'></td>";
print"<td>&nbsp;</td>";
print"</tr>";
print"</form>";
print"</table>";
?>

Form With Dynamic Questions
I've a mysql table where i stored a list of questions. My php script
executes a query which yields a different number of questions every time; i
used the loop function to create an input field for each question in the
form; and dynamically referencing each input name with the question number
i.e. question 1 is called q1, question 2 named q2, and so on.
The data is submitted using POST. I then try to retrieve all the answers by
doing a loop and using something like echo '$_POST['q'.$n.'']' except the
syntax doesnt seem to work.

Dynamic Form Update
I have the following form in which i need to updateitems.
The problem is that i do not know how many elements will be in the form
(generated dynamically)

eg
<input type = "hidden" name ="id1" value="1"><input type ="qty1" value ="1">
<input type = "hidden" name ="id2" value="2"><input type ="qty2" value ="1">
<input type = "hidden" name ="id3" value="3"><input type ="qty3" value ="5">
<input type = "hidden" name ="idn" value="n"><input type ="qtyn" value ="1">

how do i generate an array for a foreach loop to update the values in PHP
so that i can use it to create a Update query
eg
///begin loop
$sql = "UPDATE `table` SET `qty` = `$qtyn` WHERE `id` = `$idn`";
// end loop

Dynamic Form Items
I am trying to create A form that its fields will depend on a
form menu.
for example.
/***********************************************/
<form name="form1" method="post" action="">
<select name="select">
<option value="1">option 1</option>
<option value="2">option 2</option>
<option value="3">option 3</option>
</select>

Text field 1<input type="text" name="textfield">
Text Field 2<input type="text" name="textfield2">
Text Field 3 <input type="text" name="textfield3">
Text Field 4 <input type="text" name="textfield4">

<input type="submit" name="Submit" value="Submit">
</form>
/***********************************************/
When the option 1 is selected only the textfields 1 and 2 to appear,
when option 2 is selected only textfields 1 and 3 to appear and so on... any
combination I would like.

I tried puting the textfields in "if" statments but i don't like it. its too
messy PHP and HTML code.
Any Ideas of how this could be done better ? If someone did something
similar before and has a relative link it would be good as well.

Dynamic Form Pulldown
I'm building a form and need to have the options in a pulldown menu pulled from a mysql database, i understand the basics of sql and have used forms before, i just need to see an example to get me on my way.

Dynamic Form Processing
Im writing a script for processing a form created by a csv file. this form is created through a loop, where $num is the place in the loop. Code:

Dynamic Form Fields
I want to have it setup so when the user clicks this link a value is sent via get and that value is put through a for loop to generate an additional form field: Code:

Dynamic Form And $_REQUEST
My current project needs to run on both windows and linux. I figured out that windows needs $_REQUEST to read the form elements. This worked well until parsing a dynamically built form with checkboxes named: cb0, cb1, cb2, etc.

I can't figure out how I can use $_REQUEST to read the form elements, when I try $_REQUEST[$i] for example all values of the array elements are 'cc'. No idea where this comes from as cc is never used as a value?

Form Variables To Session Variables
I am writing a small script that consists of two pages:  page one displays a bunch of values from a DB (ie. First Name, Last Name, Phone Number).  On this page you will find a form that follows this format:

<input type="text" name="edit_firstname" size="20" maxlength="35" value='Bob'>
<input type="text" name="edit_lastname" size="20" maxlength="35" value='Smith'>
<input type="text" name="edit_phone" size="20" maxlength="35" value='5552222'>

So when you see the page there will already be a 'default' value in each line (which is information extracted from a DB).  This works perfectly and has been tested thoroughly.

On the second page I have the following code:

$editfirstname = $_POST['edit_firstname'];
$editlastname = $_POST['edit_lastname'];
$editphone = $_POST['edit_phone'];

What I am trying to do is this:  the default value for edit_firstname from the form is 'Bob' by default, but the user can change this in the input field on the first page.  This value, whether changed or unchanged, should then be stored as edit_firstname and by calling up the function $_POST[''] on the second page I want to transfer the value to the variable $editfirstname. 

However, it seems that $_POST['edit_firstname'] and the other fields do not return a value at all, hence $editfirstname = '' or $editfirstname = 'NULL'.  I have never tried to do things this way before. 

Form Field Dynamic Population And PHP
I have a form that dynamically generates a drop down from a table column called suppliers.

Products supplied by each supplier vary so what I want to try and achieve is that once a supplier has been selected a second drop down on the same page is populated with data from the same table / different column with that suppliers products.
(I am trying to avoid refreshing the page)

I have not supplied any code at this stage as I am not sure whether PHP is capable of doing this by itself or whether javascript would need to be incorporated.

POST Form To Dynamic Page Name
I've got a simple form with an HTML OPTION block. I'd like to POST the
form to a page whose name is based on the OPTION they select.

So for example say the user selected this option, I'd like to POST the
form to a page named "memory.php".

echo "<option value="memory">Memory Utilization</option>";

Reset Dynamic Search Form
i have a search form that has a set of checkboxes and a set of select boxes.  the checkboxes correspond to a select box and activates the select box once checked.  when i submit the search form to display the results on the same page, the elements are echoed back into the form so the user can see what search criteria he/she search for: Code:

Identifying Dynamic Form Fields
User goes to page which is a form that asks for some basic info regarding returning products for credit/exchange, and also asks for how many products are going to be returned. Upon submitting, a return authorization form is presented to them with the specified number of product fields. I now want to take the input from this form and email it to myself, as well as, display a confirmation page to the user. The problem I have is a can't say, for instance, echo "$field_name"; because field_name will get created dynamically after the user specifies how many products to return. For example, say the user says 5 products, this will generate a form with field names like:

return_code0 inv_num0 qty0 product0 cre_exch0 stockout0
return_code1 inv_num1 qty1 product1 cre_exch1 stockout1
return_code2 inv_num2 qty2 product2 cre_exch2 stockout2 and so on....

These get created with a for() loop. Once this form is submitted, how can I address the field names? Code:

Dynamic JS Form And $_POST Array
I have a form that I am altering after page load with javascript. Basically I have a button that inserts another text field into the form which the user can fill out. Its for a calendar, and I'm allowing them to optionally add multiple days for an event. Each box that is created has the same name with [] on the end to make it an array.

When I view the post array with print_r($_POST), only the first textbox's value shows up. This is the only textbox in the form when the page loads.
Simplified example:

<form name="calform" action="process.php" method="post">
<input name="startday[]" type="text" class="bordered" size="25" />
<input type="button" onclick="add_one_more()" value="Add another date" />

// if the user hits the add button it adds this input field after pageload

<input name="startday[]" type="text" class="bordered" size="25" />

</form>
And here's what I'd get from that form

Array
(
    [startday] => Array
        (
            [0] => test1
        ))

A button inside the form basically adds another <input> tag between the <form> tags. Why isn't PHP seeing the data?

Dynamic Form Option List
I want to create a dynamic drop down option list in a form, but I just can't wrap my head around this.

Both of the below scripts work as intended, but how do I make the mySql query results work with my existing script?  Yes, I know I must replace the "$options = array" part in the top piece of code, but I need a little more guidance than that. Code:

Dynamic Form - How To Set Values Of A List
I have a form with a list/menu in it that is populated with records from a database. The items in list#2 are based upon what is selected in list#1.

I have been able to use a combination of php and javascript to get it to work, but the javascript reloads the page to get list #2 to refresh - and that clears out any other fields that have been filled in. Instead of javascript being called for the 'onchange' event for list #1, I'd rather it call php when list#1 is changed and so reset the values in list#2.

OPTIONS:
1. I thought I could have a php function that is called (i.e.   onchange="<?php reload();?>" but I can't figure out how to set the values of the list from within the php function. How to reference form objects with php?

How To Process Dynamic Form Field Names
Let me start by saying I don't have a lot of PHP experience, and am just starting to fumble my way around some of this stuff... I'm sure this has been asked a number of times, but after 2 days of searching the internet, I just haven't found a solution that makes sense, so I am hoping someone here can help me.

I have a pretty simple project schedule sort of web page that lists a number of tasks & 4 dates associated with each task. (planned start, planned complete, actual start, actual complete.

The page is built dynamically based on what is in a mysql database, and the dates listed are form fields, with the intent that a person with access can change any number of these dates.

Each task has an id associated with it, so when i build the form, I name the form field <task_id>-<date type>. so, for example, for task id = 10 I have 4 related form fields:

10-planned_start
10-planned_complete
10-actual_start
10-actual_complete

This basic pattern is repeated for all the tasks (up to 100 right now, but it could grow slightly).

Once all the form fields have been updated, and the user clicks submit I want to update the data in the database with the appropriate data.

So, my questions is:

1) How can I process this form, when I don't know what the names of the fields are going to be, and/or how many fields there are?

2) Is there a good way to identify only those fields that have changed and do updates on only those fields, or am I "stuck" updating all the records, even those where the dates have not changed from when the form was built?

Dynamic Form Option Diapearing On Submit
when i submit one option field after inserting a option value and an amount the previous one i had done disappears causing me lose all the information that i had typed in and i was wondering how i could keep the information alive as well as keep the newly created form fields from diapearing, PHP Code:

Update A Ststic HTML Form To Dynamic
I have a form which I now want to be more dynamic. The datbase tables are builtbut I cannot get the fields to populate.

When a member selects an age group from the first select statement and the dates that age group are scheduled to play a match are displayed in a second select statement. When both select ions have been made the rest of the form is displayed and can be filled in and the database updated. Code:

Dynamic Fill Form Fields Depending On Dropdown Box
This question has probably already been asked, but let me ask again

I have a mysql database to which I connect with my php scripts. The
database contains articles. Name, Unit_Price and Reference

Now my client needs to order 5 items, click a button and a table with 5
lines and 3 columns appears (until now easy)

In the first column is a drop down box with a <select > and <options> in
which I store all possible names.

I would like than whenever the client changes one of the boxes (in my
case there are 5) the Unite_Price column and Reference column in the
line he just choose get automatically updated

Following Up Form Variables
i've coded a website to take information from a user, and then output it to a printable page to send in. The site is actually for a non-profit org, and this is for a contribution form.

I have a checkbox place to put into a variable called $bird[]. $bird[] prints out fine on the page directly after, but how do I keep the value of it and send that variable on to the next page? So on the next page I can also print out the value of $bird[]. On the second page, I used: PHP Code:

Form Variables
Wonder if there is any way to check all variables through a loop when a form is submitted.
I have few checkboxes (chk1,chk2,chk3...) in a form and in a php file I wanted to go through a loop to check which checkbox is 'on' and then so something with that variable.

Using Variables From Form
I've just started learning php and I hope you guys could help me with
this problem. I've found a useful pice of code from a book to make a form
and I would like to use it. I would like to print the variables (input)
on the screen , but I can't make it work. I think I have to do something
with an array, but don't know what. I've tried

$field = $_POST['field'];
echo $field;

and also

$arr = $_POST['array'];
print_r($arr);

but it doesn't work.

Could some one show me what I'm missing?

########################### code ###################################

<?php

// new function
echo "<br><br><h4>second function</h4>
";

function print_form($action="", $method="post")
{
if (empty($action)){return FALSE;}
echo "<form action=$action method=$method>
";
$numargs = func_num_args();
for($i = 2; $i < $numargs; $i++)
{
echo "$i <input type = text name =". func_get_args($i) . ">
<br>
";
}
echo "<input type=submit>";

echo "</form>";
}
print_form("autoform2.php", "", "field", "field2", "field3", "field4");

// testing if the variable exist...and it doesn't...
if(isset($_POST['field'])){
echo "exist";
}
else {
echo "does not exist!";
}

?>

########################### end code ##################################

Form Variables Without Submit
Is there a way to pass variables from a form to PHP without submitting the form? ie. retrieving a user's selection from a picklist or checkbox.

Can You _POST Variables In Php Without Using A <FORM>
The question I have, is it possible for a php script which is used to
validate values submitted in a form, to then post these values onto
another script/page or even back to the calling form?

i.e. the application I have in question is a login.htm page with a
verify.php script The login.htm has a Form which captures login_id and password which are posted to verify.php

verify.php checks the id and password against the database.
if the check succeeds I use $_SESSION to track the logged in user into
the page. if the check fails, I use $_SESSION["error"] to set an error message
and then jump to login.htm, but I've lost the userid.

The only way I can see of transferring the userid (and some other data)
is by calling header ("Location: login.htm?id=$uid");
and then have some php code in login.htm to $GET['uid'] and pop that
into the user field on the form.

Is there any easy way I can post this data back without using a <FORM>
or at least a form that can be auto-submitted?

Find Form Variables
Is there a way to read the variable names passed by a form if you dont know their names.
I have a site where the users can edit a form but I need to then process it.

Passing Variables From A Form
Well I am having some strange problems with a web-based form that is used for users to submit data. I have moved the form and accompanying PHP files across from a Redhat 7.3 install to a new Redhat 9 server running Apache 2.0.40-21, with php-4.2.2-17. So, it is stock standard. Everything was working ok on the Redhat 7.3 install. The troubles I have run into is when I try and pass a variable from a form such as below: Code:

Passing Form Variables To A Pop-up
I've searched the forums for this, but haven't seen any posts or solutions about this particular problem...I have a form in a php script that submits like this: Code:

Form Variables Gone Missing
hope I'm on-topic here - couldn't find any leads with a search so
maybe someone has an idea.

I've got a PHP form that is supposed to set some variables from
its fields and then call itself by the POST method.

Here is e.g. a minimal test version called "top.php":-

#!/usr/bin/php
Content-type: text/html

<HTML>

Welcome <?php echo $_POST["name"]; ?>.<br />
You are <?php echo $_POST["age"]; ?> years old! <br>
Welcome <?php echo $name; ?>.<br />
You are <?php echo $age; ?> years old! <br>

<form action="top.php" method="POST">
Enter your name: <input type="text" name="name" />
Enter your age: <input type="text" name="age" />
<input type="submit" />
</form>

<? phpinfo(); ?>

</HTML>

When I enter data in the fields name or age, it just gets ignored,
goes missing, thrown away by PHP. The first 4 lines that should
output this info show that the variables are all blank.

The phpinfo() call at the end shows me clearly that register_globals
is on.

The only way I've found so far is with the GET method - there the
expected arrays and variables are also broken,
but $_SERVER["REQUEST_URI"] is correctly set (yipee!) and so
I can parse that myself - sort of defeats the point of PHP though.

What could be the problem here?
Is there some other setting I'm missing?
This stuff all worked without a hitch in PHP3 - has something
else been broken in the name of security?

Passing Variables Through A Form
I have a setup where I am displaying lots of information, all of it comes from contact forms and is stored in a database. Then can be viewed on one page, through the scripts. One feature is that you can click on an email address to send an email to that specific user. When you click their email, the form comes up fine, and I have been playing with this for awhile.. I am having trouble getting the variables passed through so that I can send the email and update the database. Code:

Passing Form Variables
I'm trying to make a page that will let you change the order in which some items are displayed. The problem I'm having is passing back the id value of the item that you want to move up or down in the display order. Here is the code:

Passing Form Variables
Is there a way to read the variable names passed by a form if you dont know their names. I have a site where the users can edit a form but I need to then process it.

Session Variables In A Form
i want to create a form that updates a users account details...is there a way that i can get the form to show the users current details in each text box? then the user clicks on that box to edit the deails?

also how would i structure a query so that it only updates the edited fields? and keeps the rest the same? Code:

Form Variables And Text Characters
Well I´m having trouble with text formatting I think.
You see I have a flash form, which sends variables
via POST to a php file that looks like this:


Copyright © 2005-08 www.BigResource.com, All rights reserved