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




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?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Missing Something In Passing Form Variables
I have the following code to select an item from a drop down menu and
call the same script over again. I am expecting that after the first
time the script is run the first echo would produce the selected PBX
name (e.g. FMSite) but instead I get FMSitepbx=FMSite.

Needless to say this screws up the further processing I want to do. What
I really want to do is set a cookie containing the selected PBX name so
other scripts can get the cookie and provide specific data.

<?php

echo($_POST['pbx']);
$dbcnx = @mysql_connect("localhost", "***", "**********");
if (!dbcnx){
echo( "<p>Unable to connect to database.</p>");
exit();
}
if ( !@mysql_select_db("inet") ) {
echo( "<p> Unable to locate the iNet database. " . mysql_error() .
"</p>" );
exit ();
}

$query = 'Select Name from PBX order by Name'
$result = mysql_query ($query)
or die ('Query Failed');
echo '<form action="setpbx.php" method="POST">'
echo 'Select PBX <select name="pbx">'
while ($row = mysql_fetch_array ($result)) {
echo '<option value="' . $row['Name'] . '">' . $row['Name'];
}
echo '</select>'
echo '<input type="submit" value="Submit">'
echo '</form>'

?>

Session Variables Missing
I've been trying to add a login to a script for a client and the server
is not playing ball.

In the spirit of best advice received here I simplified it down to the
basics.

p1.php
<?php
session_start();
$_SESSION['test']="test";
print "<a href='p2.php'>p2</a>";
?>

p2.php
<?php
session_start();
print_r($_SESSION);
?>

p2.php shows just an empty array. I've tried using
session_write_close() and also passing the session id via the URL.
Nothing.

Anyone got any ideas? PHP is 4.3.9, server is running Linux and Apache

Missing $_POST Variables
I use $_POST variables to process forms. I just pushed some code to a client's server. Their server does not have $_POST,$_GET, etc variables defined. Only the old $HTTP_POST_VARS, $HTTP_GET_VARS, etc variables are present.
phptest.php shows they are running PHP Version 4.0.4pl1 on Linux with Apache.
Is there a configuration setting to 'turn on' these variables? Is their version of PHP too old?

Missing Words In Html Form...
I have a problem with forms and php. I read information from MySql into $name.
If $name contains "John Doe", the first expression print "John Doe", while the second expresseion gives me a text field containing "John". WHY?

<?print urldecode($navn);?>
<input name="name" value= <? print $name;?>>

What's Missing From This Form Mail Code?
I've got this form mail program that is called as an action from an HTML
form. It runs with no errors, but the email is never sent - at least,
it's never received. Here's the code:

<?
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

$address = $_REQUEST['address'] ;
$city_state = $_REQUEST['city_state'] ;
$zip = $_REQUEST['zip'] ;
$phone = $_REQUEST['phone'] ;
$email = $_REQUEST['email'] ;
$comments = $_REQUEST['comments'] ;
$name = $_REQUEST['name'] ;

$text = $name . ' - ' . $address . ' - ' .
$city_state . ' - ' . $zip . ' - ' . $phone . ' - ' . $email . ' -
' . ' - ' . $comments;

mail( "an@email.com", "subject line",
"$text", "From: $email" );
header( "Location: http://www.mydomain.com/Contact/thanks.html" );
?>

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. 

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:

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:

Passing Variables Through FORM -> IMAGES
I have to say this is bugging me, I'm trying to pass a variable through a form, but instead of "select" then "submit" type of form, I am trying to use IMAGES instead...

I am trying to pass the variable ($lang) , depending on the value of this variable, the page will look different (English or French )

I guess I am doing this the wrong way, I thought by giving both images the same name, but different values, it would work.... but it is not working.

here is the HTML code of the form itself :

Code:
<!--LANGUAGE SELECTION -->
<FORM NAME="pick_lang" METHOD="post" ACTION="<? echo "$PHP_SELF"; ?>">
<table border="0" cellpadding="0" cellspacing="0" width="165">
<tr>
<td rowspan="2"><img name="shadow_drapeau_r1_c1" src="tble_img/shadow_drapeau_r1_c1.gif" width="102" height="21" border="0"></td>
<td>
<INPUT TYPE="image" BORDER="0" NAME="lang" value="en" SRC="tble_img/shadow_drapeau_r1_c2.gif" WIDTH="21" HEIGHT="14">
</td>
<td rowspan="2"><img name="shadow_drapeau_r1_c3" src="tble_img/shadow_drapeau_r1_c3.gif" width="8" height="21" border="0"></td>
<td>
<INPUT TYPE="image" BORDER="0" NAME="lang" value="fr" SRC="tble_img/shadow_drapeau_r1_c4.gif" WIDTH="21" HEIGHT="14">
</td>
<td rowspan="2"><img name="shadow_drapeau_r1_c5" src="tble_img/shadow_drapeau_r1_c5.gif" width="13" height="21" border="0"></td>
</tr>
<tr>
<td><img name="shadow_drapeau_r2_c2" src="tble_img/shadow_drapeau_r2_c2.gif" width="21" height="7" border="0"></td>
<td><img name="shadow_drapeau_r2_c4" src="tble_img/shadow_drapeau_r2_c4.gif" width="21" height="7" border="0"></td>
</tr>
</table>
</FORM>
<!--END LANGUAGE SELECTION -->

I don't want to set images with links (<A HREF="$PHP_SELF?lang=$lang"> works, but I want the URL to remain clear of data)

Form Variables Not Printing In E-mail
This is my first attempt at a php-based form at work in order to personalize the form response with the submitter's name. When I submit the form, all that's returned to me via e-mail is the header information. I've been searching google but can't figure out what I've done wrong. The php to process the form is this:

How To Make PHP 'grab' Variables From A WML Form
I really can't get forms to pass data to my scripts. Now someone mentioned something about grabbing it and posted some code, but for the life of me I cannot find the email/post/whatever the hell it was, so can someone please tell me how a PHP script can be made to 'grab' a variable from a form.

Pass The Variables In The Form Of Sessions
If I have something like this how can i pass the variables
in the form of sessions to another page, where i Can calculate based on the products selected, very much like a shopping cart! PHP Code:

Editing Submitted Form Using Variables
I'm working an e-mail form for my web page. I want people to be able to fill out information and when the click submit, get a page that basically says, "Here is the information, is it correct?"
Then they can click either, "Yes" (and it sumbits), or "No", and it goes to another page set up like the form filled out the first time, and grabs the variables and places them in the "values". This is the code I have so far: Code:

Variables Not Passed From Url Or Form To Page
I use a Mac at home running OSX 10.2, and use the Apache PHP MySQL trio for developing and testing sites. I've had very good experiences with this setup and have had no major problems till now.

I noticed recently that variables added to the end of the url (the get method, ...url/page.php?var=value) are not passed to the script within the page. Forms using either the get or post method have the same problem. For example, a page named "foobar.php" containing this: Code:

Getting $_POST Variables From Form In A Function
I've loaded various thoughts I've collected into mysql. I want to write an
app, all in one file, that has the following features:

1. On initial entry, selects and displays the thoughts ( might add
pagination later - there aren't alot of records, for now.)
2. This main page includes separate forms near the top with submit buttons
to search, add a thought, view all thoughts, etc. The action for each form
is to call this same page. The submit buttons and thoughts are printed from
a function.
3. In the main logic, I am trying to do a $_POST and if isset() on each
submit button name and then call a corresponding function, do whatever it
has to do, unset the form variable and continue back to the main display.

The problem is that it's not calling any functions. The error log says that
the name of each submit button in my $_POST[] statements in the main logic
is an undefined index. I presume that they are undefined in the main logic
because the forms were defined in a function.

Is there anyway to access, in the same page, form variables that were
declared in a function on that page?

Form Variables In The Address Line.
I have created a form with hidden variables and submit button which
initiate downloading of a new page. After submit-button is pressed and
new page is downloaded I can see values of all hidden variables in the
address line of the browser. It is strange that another form does not
produce this effect (variables in address line). I cannot find out
which difference in forms originates different behavior. May be you
have some ideas?

Form Variables Not Being Read By Php Script
I've got an HTML form that submits to a php script. Now, this was done on one server, and worked perfectly fine. I upload to another server, and the variables are not being read by the script at all! If I set method=get, the variables are in the url, but the php code doesn't seem to be getting them at all. any suggestions?

Form Button Names As Variables
perhaps I am just a little tired, but I am having trouble with my form
buttons.

Firstly I name them like this
name="round".$counter."heats"
which results in variables
$round1heats
$round2heats
$round3heats
etc...
now, when I select button named ... "round1heats" ... I want to use the
variable $round1heats to remove the button "round1heats", and display heats
set for the round. To do that I assumed that I would have to:-
IF(isset($round1heats)){
show other stuff instead etc
}else{
generate and print html for button "round1heats"
}

My problem is, since all this is dynamic, since the number of heats is
variable, and is dependant on DB entries, how do I generate the $round1heats
used in the isset() so that it is recognised as a variable by the isset().
I have tried, to concat the bits as I have done in the naming of the button,
but, unsurprisingly, it spits out errors ;)
[note, $counter is still available, and is limited to the number of rounds
registered in DB.]
OR, have I been barking up the wrong tree altogether?

Keeping The Variables From Form To New Page
On a web page that I am working on there is a lead generator on the left side that asks for the persons name, phone number and email address. Currently when someone fills in that information and clicks "continue" it will send an e-mail as well as inputs that data into mySQL database.

What I want it to do is just that but then take the person to a continued form asking more questions, but without them having to re-fill in their name/phone/email. Basically this "continued form" can be accessed seperately, so it cannot be something where the continued form only works once someone fills out the mini form on the left side of any page on the site. Code:

Sending Variables To An HTML Form
I have a form in an html file that sends to a PHP file for processing. The information is properly sent to the PHP file and it is processed and validated. What I want to be able to do is this:

If there are errors in the form (found in the PHP validation), send the user back to the HTML form with the form still filled out with the information that the user had entered.
I do not want the fields with errors sent back, just the good information. There are two seperate files, the html file and the PHP file.

Displaying Variables In Form Objects
I'm trying to display information within a lookup box and a text area box. Here's the code for the form objects:

<TEXTAREA NAME="BodyText" CLASS="InputTxtBoxes" MAXLENGTH="10000" COLS="100" ROWS="20" VALUE="<?php echo $BodyText ?>"></TEXTAREA>

<SELECT NAME="AuthorName" CLASS="InputTxtBoxes"><OPTION VALUE="<?php echo $AuthorName ?>"></OPTION>

When I print these variables out they do contain the correct values, but when I try and display them within these form objects they don't work at all. The BodyText is stored in a blob in the database and usually contains relatively large amounts of data (300 - 500 words). Any ideas?

Changing Variables In Another File Through A Form.
I'm trying to change the value of some variables in an include file through a form.
I have modsettings.php which contains the variables to change, and modarmin.php which has a form that contains radio buttons which need to switch the variables in modsettings.php to either true or false. Then refresh the form page with the updated values. Currently when I submit the form I am taken to the file modsettings.php and the variable values are not changed. PHP Code:

Populating Form Fields With Variables
The script itself works fine: mail gets sent. If there are any missing fields the form displays again with a list of the missing fields, but I can't get the form fields of the reloaded form to be populated with teh existing values. PHP Code:

Passing On Variables On Form Using HIDDEN
I'm trying to pass some variables from a "php_self" type form. So, far I'm trying the HIDDEN input type in order to pass the variables once the form reloads. The form returns with empty fields.

Once the values appear I have to make the form add the values for each loop iteraction. (there's a for-loop creating the table rows dynamically.) PHP Code:

Form Variables Not Sent To MySQL Problem
Here's my setup: PHP5, mySQL, IIS6, Win2003
I have no problems serving up PHP scripts, and I can access the DB.

The problem I have is this.

On pageA.php I have a form. I post this to pageB.php which adds a date
variable and then is supposed to insert the form data (along with the
date variable) into the DB.

The problem is, none of the form variables are being send to the DB. My
code was working fine on a different host(different platform config.)
So I suspect that it is a config issues, but don't understand why the
data from the form isn't being passed to the DB.

Can A Form Change Session Variables?
In the first page I declare a session variable. Than, on the same
page, I make a form which contains a variable which has the same name
as the mentioned session variable. Pressing the "submit" button of the
form I go to the second page which immediately redirects me back to
the first page (with the "header"). And the mentioned variable does...

Encrypt Form Variables During Submission?
I've been looking around the net for a solution (I'm pretty new to php) on how to encrypt a form variable before you submit it, is this possible?

To give you an idea, I have a "change your password" type form and when the user enters their new password and clicks submit the password is sent out in the open before it's encrypted (md5) and put into the database. I'd like to encrypt it BEFORE I send it though. I plan on using SSL but I'd also like to see if what I'm trying is even possible.

Displaying Variables In Html Form
Below i have a form which i want to be filled with variables sent from the last page. can anyone tell me why the variables are not showing - I think its something to do with the syntax of the php inside the html form Code:

Passing Variables To Fill A Form
how can I send variables from a php page to a form - i need to fill the form with these variables? maybe using (the process of passing variables to other pages - through url) but how can i assign them to form variables ?

PHP Not Populating Form Variables Passed Through POST Or GET
I"m running:

Windows Xp SP2
Apache2
PHP5
MySQL4

Everything seems fine and dandy, and I can do scripting on server side, but for some reason I cannot get data from a form to be put into a variable.

I have a simple form in an html page which submits, and in the php script that handles the input, none of the data in the form is going into the variables.

My php.ini file does have all the GPC's in place(ie variable_order, the way they get processed).

Firefox Causing Empty PHP Form Variables??
This is really weird, and I would never believe it possible if it
weren't actually happening to me.

I've a customer database in mySQL, using PHP to create the forms, yadda
yadda.
All of a sudden, every time I edit a customer, when I submit the form
using Firefox 1.0.2 on Linux (Fedora Core 3) it sends empty form fields
to the database.

BUT, if I use Firefox on Windows, or Opera on Fedora Core 3, it works
perfectly fine.

Any ideas what in the world could cause this?
Firefox on Linux worked fine to up until...the last few days I think.
The only think I can think of, is I may have installed a couple of
extensions during that time.

Setting Variables For Only The Selected Items In Form
when a form has a question where the response can be one or more selections either from a series of chech box inputs or a selection list, how would i set into variables only the responses that are checked or selected so that only these values are available for exporting to a mySQL database?

Carrying Over Variables From A Form To Multiple Pages...
I have some data from text fields that are being passed over through a
form that I am displaying with the $_POST superglobal. Once i have
echo'd out this data onto the next page, i'd like to continue to use
it on the next page. I haven't figured out how to do this properly
just yet, but I'm guessing it has something to do with sessions. I
have MANY variables being passed (over 100) and I'm hoping i don't
have to register each one of these manually with $_SESSION[].

example.

//first page (index.html)

<form action="form.php" method="post">
<select name="color"><option value="blue">blue</option><option
value="red">red</option>
<input name="submit" type="submit">

//new page (form.php)
<?php
echo "Bill's favorite color is {$_POST['color']}";
?>
////

Now say I want to use this $_POST['color'] value on another page that
the form.php takes you to next.....how do i continue to use this value
across multiple pages?

I'm assuming this is a trivial question, but i can't seem to figure it
out!

#2: Creating 'output' With Form-collected Variables
Some dumb questions may follow...

I am learning PHP for a simple specialized calculator/curve-fitter
that collects input from a user then fits the data to their range of
conditions in the form of a table (actually just two columns of
output).

I bought a copy of Dmitri Koterov's book with a title something like
"Create your Web Page with PHP'. What I like about it is it explains
the how and why significantly instead of just examples.
I may eventually find an answer in there, but I'd like to supplement
reading with questions...

It APPEARS to me that my task will be even easier with PHP than
previous efforts with JavaScript.

It looks like I can simply ECHO the processed data embedded in tags,
like a <LIlist or even a <TABLE. With JS I got lost trying to
figure out other examples people referred me to with get inner html &
item ID etc...got too abstract for me.

It doesn't need to be fancy...thus far, I think the echo method may be
adequate.

So, at last, the question...I previously had trouble with JS figuring
out how to make variables accessible to more than one script (make
them 'global'?).

I think PHP is more flexible with variables...whether or not it is a
good practice, they apparently do not need to be explicitly defined by
type (they are interpreted by content?), but are they automatically
assumed to be global?

What do I need to do to them to make them be 'global' or "remembered"
for use by more than one script? What then would be their
'lifetime'...cleared when the script is exit-ed, or until refreshed by
a new form Submit? (Maybe what I'm hinting at is whether or not there
is the concept of a 'session' that gets reset somehow.

Lastly, can Submits of form data for the purpose of recalculation be
'processed' by other means than pressing a Submit button, like a
MouseOver or MouseOff kind of thing?

Problem With Form, Variables, And Refreshing The Page
I use php 4 and mysql.

I am quite new to php. I have looked high and low for a solution to
this problem. It has to do with my lack of understanding of variables,
I think.

I have created a simple php file that has a form at the bottom where
the user can enter data that will update the page he is on. When the
user click the submit button the data is copied into the table and the
web page shows the new record along with the others, as it should.

However, if the user later refreshes the web page, the data in the
last form is entered again into the table.

To prevent this I have tried something like this:

if($fname!="")
{
$fdatetime = date('Y-m-d h:i:s');
if(mysql_query("INSERT INTO comments(fname, femail, fcomment,
fdatetime)
VALUES('$fname','$femail','$fcomment', '$fdatetime')"))
{
$fname ="";
}
else
{
echo "could not insert the data, sorry!";
}

}

I thought $fname =""; in conjunction with if($fname!="") would solve
the problem, but no such luck.

The elements in the form are named fname. femail, fcomment.

One more question, instead of echo "could not insert the data,
sorry!"; I would rather like to post a message in a messagebox of some
sort. Is that possible

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.");
}
}

$_SESSION Variables In A Form Titles Not Updating?
I have a form that updates and the output goes to itself (same page name). It works fine, but when I try pulling some of my $_SESSION variables into the output as text - for the titles and subtitles in the page - they do not reflect what got selected with the radio button.QUESTIONS to clarify:

1) Is there anything wrong in the way I am trying to execute this in the script below (I am new to using $_SESSION variables)?
2) Is there a better way for me to pass information to the titles that is also (succesfully, right now) being passed to my graph files under the system below.

Beginning code which is likely relevant? PHP Code:

Multi-pages Form Using Session Variables
I am trying to break a very lengthy php form into several pages but I am having some problems partly b/c For testing purposes I created 3 very simple forms: page1.php, page2.php and page3.php which shows contents from page1 and page2. Eventually I would like to send this data to the database. PHP Code:


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