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


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Pass Values Of Dropdown Boxes Into Variables.


I have a form I am creating, it has a total of three drop down boxes the first gets its info from the database the second is just static, and on the second drop down box I have added an on change event which calls a function, like this.

<select name="names" id="region" onchange="getregion()"

First question is, will that call a function in PHP? Second question is the function I need to write must have the values of the first and second text box, do you have to post this data to pass them into variables?




View Complete Forum Thread with Replies

Related Forum Messages:
How To Pass Javascript Values To Php Variables.
how to pass javascript values to php variables.

View Replies !
Hide GET Variables --> Pass Values Using Session
I have a php file which lists some records. On this list, the records
can be sorted on different columns. currently the sort column and the
direction of sorting is passed using GET values, this means the user
clicks the column name (which is a link) so the new sort column and
direction is passed to the script

<a href="main.php?page=news&sortfield=title&sortorder=asc">

now my question is, if it's possible to hide those values, so they
don't appear on the url, but sorting should work anyway. This means
that

1. when user clicks on column, the new sort order has to be set
2. page has to be reloaded, so new sort order gets displayed.

I'd like to do this using sessions, but I don't know how to update a
session value, when clicking on a link wihtout using GET values...

View Replies !
Multiple Dropdown Boxes
I setup 5 dropdown boxes for user to search data using them individually or combinations of two or more, upto all 5 parameters. This/these parameter(s) is/are then "$_POST" to a mysql_query statement as follows:

$s1 = $_POST["dropdown1"];
$s2 = $_POST["dropdown2"];
$s3 = $_POST["dropdown3"];
$s4 = $_POST["dropdown4"];
$s5 = $_POST["dropdown5"];


$query=mysql_query( "Select * from Table Where field1='$s1' and field2='$s2' and field3='$s3' and field4='$s4' and field5='$s5' ");

I know this will give me result which fits all 5 parameters only. But I want to get result according to whichever dropdown boxes selected (may be any 1, 2, 3, 4 or all 5) by user. Anyone has any idea how to rewrite the "Select" statement ?

View Replies !
Three Dynamic Dropdown Boxes
Can any one help me in dynamic drop down creating? I have three dropdowns One for Country one for state and one for location. My plan is to select the country from dropdown according to this i have load the values in state drop down from MySql table. Depending on the state i have to select the location too.

View Replies !
Dropdown Boxes Size
How do you make several dropdown boxes the same size. Not counting >-All-< even that doesnt work good. So is it on this side of the code:

<option value="">All</option>";

$Menu .= "</select>
";

Or is it on this side:

<tr>
<td><b>Apples:</b></td>
<td colspan=2><?=$Menu?></td>

</tr>

So to be short how and where do you control the size of the dropdown box?

View Replies !
Selections On Dropdown Selection-boxes
I have a article manager script that im nearly done with and when you press save, it takes you to another page to check that you have entered the required fields by checking for the POST vars, if not it redirects back to the page and stuffs the entered fields into GET vars header( location: file.php?errors=$errors&var1=$var1 ) 's you back to the previous page.

Now i have no trouble reshowing the entered info in regular text fields as i grab it from GET but i dont seem to be able to reshow a drop down box selection it always reverts back to the first option when i redirect the page.

View Replies !
Insert Date To Database Using Dropdown Boxes
I be able to insert the date into my database if i have 3 dropdown boxes wherein it contain the month,day & year. i know the basic of inserting data into my database but with this 3 dropdown box i don't have any idea. after submitting, the data selected on these 3 boxes shall be in one field in my database with fieldname Date.

View Replies !
Data Entry Form With Dynamic Dropdown Boxes
I am working on a Form for user to register & enter their info such as name, email, address, tel etc. and I put in a couple of dropdown boxes namely country and city where user can select. I made them dynamic, i.e. the city dropdown is based on the selected value from country and the data retrieved from MySQL database.

The problem I have is the Javascript script involved a reload of the form and once I select a value from Country, the city dropdown populated with data OK but the data entered beforehand (Name, email, etc.) disappeared.

View Replies !
How To Pass The Value Of Selected Dropdown Menu To Another File?
there is a php-myql script that list the mysql databases in the drop-down menu, use wil select one and the submit button should pass the value or variable $db_name to the test.php, this script list the databases in the drop-down menu but when i select one and then click on submit cannot pass the db_name to the test.php:

View Replies !
Check Boxes With Different Values
I have 4 check boxes (r1, r2, r3, r4)

$r1 = A
$r2 = B
$r3 = C
$r4 = NY

I then have a hidden field $region (to collect values to be entered into database)

<input name="region" type="hidden" value="<?php echo ("$r1 $r2 $r3 $r4");?>">

So $region is entered into the database. easy. THAT WORKS FINE. The tricky part. Code:

View Replies !
Passing Values From Text Boxes
what I'm trying to do is pass some values from text boxes, yes it may sound simple, but let me explain more... I've got a form, and what I want to do is that when you enter a new question and select a existing category from the drop down box, it then inserts the values into the database no problem. However if enter a new question, and a new category, then submit the info, I get a null value. The Code...

View Replies !
Moving Values Between Select Boxes
I am Moving Values Between Select Boxes using the following code snippet Code:

View Replies !
Get Dropdown Values
I am having trouble getting the values from a dropdown <SELECT>list and using the selected value as a part of my SQL statement. Code:

View Replies !
Submit The Values That Are Typed Into The Boxes Into My Database
i have a form and i want to submit the values that are typed into the boxes into my database when the user clicks the submit button. Would anyone know the link to a tutorial that will show me how to do this or have a sample themselves that does what i want.

Ive tried looking up google, but i cant seem to find something specificlyrelated to what i want to do. a lot of the samples post the data to an email rather than a mysql table.

View Replies !
Pulling In Values From A Database Into Text Boxes.
I have code that is pulling in values from a database into text boxes. Everything seems to be working fine except if the value has a space in it, the text box only shows up to the space. For example if the value in the database is "John Smith" the text box only shows "John".

View Replies !
Retrieve Values In Dropdown Box
I would like to retrieve values in drop down box from database table. It should be the date value. The date is stored as 'yyyy-mm-dd'. I would like to retrieve , yyyy, mm, dd seperately in a drop down box. Ihow i can make it.

View Replies !
Values From DB Into A Dropdown Menu?
Here's my database which shows which type of cards have been issued to a football player in my database: Code:

View Replies !
Query From Db, Add Values In Dropdown Menu
i wanted to query my db, and then add values to drop down menu, where when they select what they want in the dropdown, it will bring them to another page accounts.php where they will have more options.

View Replies !
Auto Select Dropdown Lists From Db Values
I want a simple HTML drop-down list like this: Code:

<select name="select_1">
<option name="option_1" value="option_1" selected="true">
<option name="option_2" value="option_2" selected="false">
</select>

to be able to automatically select a value according to a value in a table in the database. For example, if a MySQL table has a field named "field_1", and one of the rows has a value of "option_1" in that field, I want the list (using PHP of course) to automatically select the option name "option_1".

View Replies !
Get The Values Chosen In The Drop Down Boxes To Correspond To Specifc Fields In A Database?
The purpose of this application: I need 2 combo boxes, one with months, and one with years. When the user chooses both a month and a year, a page is displayed with certain numbers that are retrieved from a database. Those numbers correspond to the specific month and year. For example, January 1998 produce "12", but February 2001 might display "73".

So I guess I'm asking 2 questions. The first is just a general outline of how someone might go about doing this (to see if i'm on the right track in my thinking). The second, and more important question is for someone to please explain to me how do I get the values chosen in the drop down boxes to correspond to specifc fields in a database?

View Replies !
Add Variables To Dropdown List
I have a list of variables:

$variable[0]
$variable[1]
$variable[2]

The amount of variables changes so i've used $total = count($variable) to find the amount there are.

How would i tell php to create a dropdown menu with the amount of options=$total and then fill the options with $variable[0] etc.

I know i can use a loop to increase the value of say $i by one each time to that i can use $variable[$i] each time, i'm just stuck with adding the whole thing to a dropdown menu with the right number of option...

View Replies !
Trying To Pass 2 Values
I am trying to pass 2 values in the URL, but for some reason they keep combinine to each other... I wanted to send over the groupid and the zipid, but it keeps sticking them together. Code:

View Replies !
Pass Two Values
i also asked problem similar to this in my previous post. i am displaying users with class id and user id in the table format now every row has delete button. i want class id and user id to delete the user.

View Replies !
Pass Php Values To Frames
i want to pass a value after a sucessfull loggin to an other frame which opens after retrieving the value some mo functions. but i ain't get it to work.

View Replies !
Pass Values From Form Using URL
I am creating a search box that the user types a value in, and then
this gets passed to another page called search.php

I would like to be able to pass these values through the URL, but I
cant seem to figure out how. Right Now I have a simple html form that
passes the value through posting, which I can then pull with a
$_POST['name']. But I need to have this value be passed through URL.

View Replies !
Pass Values Of Arrays To A New Page
How do i pass all the values onto another page that I have gathered. If I have a form and place info into the array, how do I pass the value in that array over to a new page.

View Replies !
Pass Array Values In A Form
I have an array and I want to pass all the values of this array in a form object ( a drop down list for example). I can't find how can I do this, I can only pass the values one by one, but the problem is that I don't know how many values I will have.
Any suggestions?

View Replies !
How To Pass Hidden Values By HTTP Headers?
I have a script passing value to a next php page, but the value
appears in the headder, making it visible. How do I hide the value?

header("Location:http://$HTTP_HOST/$DOCROOT/registration_success.php?userid=$userid");

View Replies !
PREG Search For Multiple Values In One Pass?
I am trying to do a search through some data, more specifically HTML,
to extract data from it. So for example I may have:

<b>Title:</b<em>This is a title</em>
<b>Name:</b<em>Fred</em>

I wish to grab the data "This is a title" and "Fred" against their
corresponding headings in an array (e.g. $array[title] = "This is a
title") .... but the key doesn't matter, that need not come from the
regexp but I can do manually.

The question is - how do I do this in one pass? Do I just use use
nested OR's in my regexp? The problem with this though, is once a match
is made, how does PHP then tell me what it corresponds to if it's an
OR? (it just returns the match surely?)

Actually i'm not even too sure how to go about doing this... do I need
backreferencing etc...? I've read the php.net pages but couldn't
entirely make sense of the various preg functions.

View Replies !
[php] Using Session To Pass Values From A Popup Window...
i got a problem here. its like this... i have a popup php page... in it details of what is stored in my database is retrieve and displayed out.... but i want to pass the values that is displayed out in the popup window to the main window by using session .....
how can i do that?

View Replies !
Can I Pass Multiple Values In A Query String
I need to pass  a couple of values in a query string. Is this possible. I have the following code but get a parse error. Code:

View Replies !
Getting Query Values Into Text Box, Then Pass Them To Another Page
how do i get the values from a query from a db into text box's, in a form, so i can hit submit and it goes to an "update" page? Code:

View Replies !
Pass The Date Values To A New Window/iframe
I have page called contracts.php form for selecting arrival date and departure date, after selecting those dates I want to pass the date values to a new window/iframe called price.php

where I can enter total price, balance, numdays..etc in that iframe again when I click on submit/close button in the new window/iframe it has to come back to contracts.php page with those entered values.

View Replies !
Cookie, Session, Parameter To Pass The Values, What Else?
For example, I am writing the backend admin pages to mangae the staff records for a company company will have two locations, chicago and new york. and they will have two apartments, accounting department, and sales deparment in both locations. Code:

View Replies !
Pass Multiple Values In A Select Menu.
I need to pass multiple values in a select menu. How do I do this? How do I also pass SurName and FirstName? PHP Code:

echo '<select name="ffnumber" id="ffnumber"><option value="0">Select Name</option>'
while($row = mysql_fetch_array($result))
{
echo '<option value= "'.$row['FFNumber'].'">'.$row['SurName'].' '.$row['FirstName'].'</option>'
}

View Replies !
Pass The Array Values Stored In The Session Through Url To Next Page?
how can i pass the array values stored in the session through url to next page?

View Replies !
Form Validation To Autofill The Previous Drop Boxes And Check Boxes
I have a form and when the form is submitted it is validated and processed. If validation is failed it returns the form on an error page and lists what was required that was not entered. It also auto-fills the previous submissions back in but I cannot get it to change drop-boxes or chec boxes.

View Replies !
How Do Pass Two Variables?
I have the following code that passes the email variable.

<meta http-equiv="refresh" content="4;URL=http://www.mysite.com/mypage.php?email=$email">

How do I pass two variables?

View Replies !
Does Not Pass The Variables
I am trying to send an email using php. Below is my code. It all works fine accept for the $message variable. It does not pass the variables $first $last.

<?
$first = "Mike",
$Last = "Daniel";
$email[body] is populated from MySQL database that contains: Hello $first $last

$to = "name@domain.com";
$from = "anothername@domain.com";
$subject = "Testing";
$message = "$email[body]";
$headers = "From: $from
";
$headers .= "Content-type: text/html
";
$success = mail($to, $subject, $message, $headers);
?>

The email body I receive looks like this: [Hello $first $last] I need it to look like this [Hello Mike Daniel].

View Replies !
Pass Variables
I have one variable in a script and i want to use the same variable in other sctipt By example, I have this variable: $pass in the script : info.php and I want the the same value of $pass pass to other script like info2.php PHP Code:

session_start();
$pass1 = $_SESSION['$pass'];


View Replies !
How To Pass Variables To JS?
How do I pass PHP variables to JavaScript in the returned browser page?

View Replies !
Variables Pass
The domain name was pointed to the GoDaddy parked servers until today. I just changed them to the permanent domain name servers this morning. It takes a couuple of days for the domain name to propagate. Below is the exact code: PHP Code:

// test1.html
<html>
<head>
<title>test: UserName eregi</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body
{
margin-top: 150px;
margin-left: 250px;
background-color: #FFFFFF;
}
</style>
</head>
<body>....

View Replies !
Pass Variables From One Php File To Another.
Could somebody please give me a hint on the following problem.
1. I need to pass variables from one php file to another.
2. I need some few different forms and want to pass every variable to another (same) page.

View Replies !
Methods To Pass Variables
I am trying to pass 8 variables from a search form to different pages and I am confuse whether to use:
1) session
2) cookie
3) passing variable through URL
4) Using hidden form field

My page#1 is a search form and with 8 Select fields. After press Submit Button, page#2 shows all the search results. Some search would show up 100+ rows so I am using a script to break the result pages. Each display page would limit 20 records with links <<Previous 1 2 3.... Next>> at bottom.

However only the first search result page would show up properly but rest of search result won't showup.

I read a few threads on this forums and I wonder what is the best method to use in my case??? It seem passing variable through URL is inefficient in my case since there are 8 variables. With session or cookie, what happen if the user decide to do another search (page#1 search form) without closing browser will the session id renew itself. With hidden form field, since my Page#2 (result display page) is not using form, will it work.

View Replies !
Pass Get Variables Using PHP Header()
I got a form page with 'update' & 'cancel' buttons. When 'cancel' clicked, I want to be redirected to the index page on the right page number.

URL of my edit page is like this:
http://localhost/form.php?op=edit&id=1&cursor=2

In the form.php I got few lines of code to get that 'cursor' before doing redirection:

$iCursor = $_GET["cursor"];
$url = 'index.php?cursor='.(int) $iCursor;

if ($_POST["cancel"]) {
header("Location: $url");
}

The new URL is supposed to be:
http://localhost/index.php?cursor=2

but it showed up like this:
http://localhost/index.php?cursor=0

I've tried using sessions variables as well, but the value of the cursor's still 0.

Do you guys know what happened?

View Replies !
How To Pass Variables To PHP Binary (CGI)?
My system use to run PHP as an Apache module. And I pass in variables like this:
http://www.somesite.com/somefile.php?IDvar=1

Now my system runs PHP as a CGI. So I am running the same script like this:
/usr/local/bin/php /somepath/somefile.php

How do I pass in the variable IDvar and value 1?

View Replies !
Can't Pass Variables By URL On Localhost
I'm developping on localhost (127.0.0.1). When I try to pass parameters from one page to another using the standart way (URL), I just can't retrieve the values. In fact, the isset($varname) returns false. Code:

View Replies !
How To Pass Variables Across Php Scripts
I want to know how to pass variables across php scripts. Im thinking maybe I need to make them global variables but Im not sure. what i have is this.

on page one there is a form for login/password with variables $login $password. when they click send it goes to a auth script...if the script auths that user in a database, it then goes to a redirect script which redirects users to a certain page based on the date. So my question is, how do I make $login available to the end page that the user is sent to. maybe

$user = "$formlogin";
global $user;

View Replies !
How Do Pass Variables In URLs?
How do I pass variables in URLs? Something like link.php?id=5.....
I am new to PHP and I have done variable passing similar to this scenario in CFML and ASP.

View Replies !
Pass Variables To Functions
In php i've found that I cant seem to access global variables from within a function. Is there a way to access variables in a function that are in the same scope that the function is??? Can you make a variable global or something? How does that all work in PHP, is there a doc somewhere to explain? Can I define a global within a function in php?

View Replies !
How Do I Pass Variables On A Location
i have a script which creates 2 variables which then does a redirect to a page which then uses a query using the two variables. But i was wondering how to get the code to pass across the page... Code:

View Replies !
Pass POST Variables
what would be the most effective method to pass a variable via the POST method in XHTML without having user input. Is this even possible, or would it be more efficient to use sessions?

View Replies !

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