473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

passing a variable from a form to php

Hellow,

I don't seem to be able to send trough the variable 'language' from my
form to the php-variable $language that I want to use in my session...
I first tried in the form with a drop down menu (select) and now with
radio-buttons but it won't work... What am I doing wrong?
BTW: the variable 'toevoegen' is passed correctly from the form to the
php.

<?php

session_start();
session_register('language');

echo("Taal is $language <p/>");
echo("Toevoegen=$toevoegen <p/>");
if (!IsSet($language)){

$result = mysql_query("SELECT * FROM languages ORDER BY mylanguage");
if (!$result) {
echo("<P><b>Fout bij uitvoeren query: </b>" .
mysql_error() . "</P>");
exit();
}
echo("<FORM ACTION='$PHP_SELF' METHOD='POST'><INPUT TYPE='hidden'
NAME='toevoegen' VALUE='1'>");
while (($row = mysql_fetch_array($result))){
echo("<INPUT TYPE='radio' NAME='language'>".$row["mylanguage"]);
}
echo("<INPUT TYPE='submit' NAME='kies_taal' VALUE='Choose
language...'>");
echo("</FORM>");
}

else{
echo("Uw taal is $language !");
}
?>
Jul 17 '05 #1
1 2468
bawar wrote:
Hellow,

I don't seem to be able to send trough the variable 'language' from my
form to the php-variable $language that I want to use in my session...
I first tried in the form with a drop down menu (select) and now with
radio-buttons but it won't work... What am I doing wrong?
BTW: the variable 'toevoegen' is passed correctly from the form to the
php.

<?php

session_start();
session_register('language');

echo("Taal is $language <p/>");
echo("Toevoegen=$toevoegen <p/>");
if (!IsSet($language)){

$result = mysql_query("SELECT * FROM languages ORDER BY mylanguage");
if (!$result) {
echo("<P><b>Fout bij uitvoeren query: </b>" .
mysql_error() . "</P>");
exit();
}
echo("<FORM ACTION='$PHP_SELF' METHOD='POST'><INPUT TYPE='hidden'
NAME='toevoegen' VALUE='1'>");
while (($row = mysql_fetch_array($result))){
echo("<INPUT TYPE='radio' NAME='language'>".$row["mylanguage"]);
}
echo("<INPUT TYPE='submit' NAME='kies_taal' VALUE='Choose
language...'>");
echo("</FORM>");
}

else{
echo("Uw taal is $language !");
}
?>


use $_POST['language'], $_SERVER['PHP_SELF'] $_POST['toevoegen'],
$_SESSION['language'], etc.

or, look up register_globals...
http://us3.php.net/manual/en/securit...terglobals.php

--
Justin Koivisto - sp**@koivi.com
PHP POSTERS: Please use comp.lang.php for PHP related questions,
alt.php* groups are not recommended.

Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Paul | last post by:
I want to use sessions to cover myself in case the user switches off cookies so I am passing the session ID manually through a hidden input field. This is what I have so far. index.php page...
1
by: Paul | last post by:
Hmmm, didn't seem to work. I have set session.use_cookies = 1 and session.use_trans_sid = 1 in my php.ini file. Index.php contains:...
3
by: domeceo | last post by:
can anyone tell me why I cannot pass values in a setTimeout function whenever I use this function it says "menu is undefined" after th alert. function imgOff(menu, num) { if (document.images) {...
6
by: veganeater | last post by:
Hi Everyone, I was wondering if there was a way to pass a variable to a popup window. The purpose is make it so when a user clicks on a specific region/link of the glossary page, a popup opens...
3
by: JJ | last post by:
Hi, I need to pass a dataset to another win form along with a SqldataAdapter. I don't want to recreate the SqlDataAdapter again either. So to pass to another Win form in my windows form app, do...
8
by: Johnny | last post by:
I'm a rookie at C# and OO so please don't laugh! I have a form (fclsTaxCalculator) that contains a text box (tboxZipCode) containing a zip code. The user can enter a zip code in the text box and...
13
by: Deano | last post by:
Apparently you can only do this with one value i.e Call MyAssetLocationZoom(Me!txtLocation, "Amend data") This runs; Public Sub MyAssetLocationZoom(ctl As Control, formName As String) On...
9
by: itarizin | last post by:
Today I found as ignorance owe me.. Let me explain what I'm tring to do and fail (fail: in my needs) For example, I've my stupid class: public class Hello { private int x = 0; public...
1
by: rfr | last post by:
I have a need to use a single version of a Visitor Response Feedback Form on numerous HTML documents. Rather than have numerous versions of this, one on each HTML document, it makes more sense to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.