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.





Session Variable To Pass The Id Selected From A List?


I have a list which the user can select from in order to go to another page with details of the selection. I currently have the id of the selection being passed on the link as follows: PHP Code:




View Complete Forum Thread with Replies

Related Forum Messages:
Cannot Pass A Session Variable
i tried a simple login functionality. my requirement is ,if the login usermane and password is correct , display the username in the next page(user's page). The username cannot be displayed the next page.

This code works fine in my local machine with PHP Version 5.1.4, but dosent work in my webserver with PHP Version 4.3.4. The username is displayed in the 'userlogin1.php' page when working in local machine.. but not in webserver. Code:

View Replies !
Session To Pass A Variable From One Page To The Next
I am using a session to pass a variable from one page to the next. The user makes a selection in the first page and that variable is passed from one page to the next via the session. Once they make their selection on the form on the index page and click submit, they are sent to the homepage where the following code is run:

<?php session_start();
$pcode = $promocode;
session_register("pcode");
if ($pcode == 'tree'){
$text = 'this is stuff I wanna say'
}else if ($pcode == ''){
header('location:blank.php');
}else if ($pcode !== 'tree'){
header('location:invalid.php');
}
?>

What I am trying to do is prevent the user from having to reenter the variable when they return to the home page. Right now, it is forcing them to the blank page and asking that they reenter the promocode variable.

View Replies !
Pass Session Variable Between Separate Domains
I'm wondering if there is a way to pass a $_SESSION variable from one site to the next.

ie, I have $_SESSION['userid'] on mysite.com, but i want the session to remain accessable when redirected to forum.mysite.com.

is this possible?

View Replies !
Way To Pass The Selected Records To The New Page?
I have a dynamic table and use a check box in every record. I want the selected ones to open in a new page. What shall I do? I mean, what is the way to pass the selected records to the new page?

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 !
Multiple Selected="selected" In A List.
I have a database with 1 to many and the many is a list with multiple
selects in a list. When I click on a master record I have as part of
my form the select statement for the multiple choice list. I want the
list to highlight the multiple chosen values. here is part of the
code.

$dresscat = specdresscat($dresstypeid); //this is the query to get the
values in the detail table
$drcatrow = pg_fetch_array($dresscat);// the array for the detail
table.
<select name="stages[]" multiple="multiple">
<?php
$allstages = allstages(); // this is a function to query my database
to get the value for the list.
while ($allstagerows=pg_fetch_array($allstages)) {
$eachstage= $allstagerows["stageid"];
$specstage= $drcatrow["stageid"]; // this is the point I need help
if ($specstage == $eachstage){ ?>
<option value=<?php echo $eachstage;?> selected="selected"><?php echo
allstagerows["stage"]?></option>
<?php }else{ ?>
<option value=<?php echo $eachstage;?>><?php echo
$allstagerows["stage"]?></option>
<?php
}
}
?>
</select>

View Replies !
Selected List Item Value
I know that the value for each element of my form is available through $_POST 'element_name'] but this doesn't work for lists. Can anyone tell me how I refer to the item selected in a list (combo box)?

View Replies !
Html Pre-selected List Box Scrolled
Is it possible to have a list box with a pre-selected value automatically scrolled to that value when the form is loaded? i.e. if the size of the list box is 3, and the 4th value is pre-selected, I want the list box to appear starting at the 4th value in the form.

View Replies !
How Do You Do Selected In A Multi-value List Box In A Form?
I am populating a list box from a dictionary table and then picking
muliple values to insert into a detail table. How do I get the list box
to have multiple selections highlighted when I pick one of the master
items?

View Replies !
List All But Echo In Checkbox Only Selected
There is a 3 table: I want to list all the product groups but to be checked in checkbox only what choose the user.

If from outside (choos.php?tt_reg_id=1) user is nr 1 then in listed checkboxes need to be checked only those checkboxes what the user nr 1 choose / but listed the all product groups. Code:

View Replies !
Best Way To Show Selected Option In List Box
I need a way so that we can show selected option in list box without using if condition in loop since some times we have lot of options and we have too much if conditions to check.

View Replies !
User Selected Order Of List
My experience in php and mysql is just copying and pasting freebie scripts- very limited.
I'm wanting to create or better yet find another freebie script which will in my real estate site on the page with a table listing properties with headings such as
date/ type/beds/baths/price etc.

users be able to click on a heading which will then list the properties according to the selected heading, so if they choose 'type', the page will refresh and show all houses or land or apartments according to type grouped together and so on. First I think I need to have a link on the heading buttons to activate a php script which will send info to mysql database and if the database is configured right through the admin area it will respond accordingly. But what php script? How complicated could it be?

View Replies !
Dropdown List Selected By Default?
Does any one know how to have an item in the dropdown list selected by default?

$city_field = HTML_QuickForm::createElement('autocomplete', 'city', 'City', $cities);

$cities is an array of city names and I would like, say 'Los Angeles' selected by default.

View Replies !
Transferring The Selected Record From The List Box To Textbox
Breifly, I've 3 list boxes.Select a record from the first one, click a button, the second list box is filled and select a record now and then click a button, the third list box is filled.Now, select the record, the selected record has to be shown in the text box.But, I also want to show one more field related to this one in another text box.How can i do??

well, the first list box shows the topic names, 2nd one the sub-topic names and the third one the article names. Now, when i select the article name, the article name and the article content has to be shown in the text boxes.

If its just article name, i know how to do it by java-script but i also need article content to be shown. Could somebody please help me how should i modify my code and where should i insert the text boxes?? Also, one more question, If i make any changes to the data in the text boxes, i would like to update.How can i do that?? PHP Code:

View Replies !
Combo/list Box Showing Values Selected
I have a combo box being populated dynamically through php using a mysql database, and everything works fine.

My question is: How would i make it keep the values selected, once the user hits the submit button? For example, let's say i have a combo box with the values 1 2 3 4 5 in it. The user selects &#393;' and hits the submit button (which posts to the same page). At that point, i'd like the combo box to still have &#393;' selected, instead of resetting itself.

View Replies !
Populating Drop Down List With Selected Vaue
I have a drop down box and the "selected" value needs to be selected by a dynamic value that gets entered into the database, this is currently how im doing it: PHP Code:

<?php
                if($modify_row[21] == "0") {
                  print "<option value=" "></option>";
                  print "<option value="1">Active</option>";
                  print "<option value="0" selected>In-Active</option>";
                } elseif ($modify_row[21] == "1") {
                  print "<option value=" "></option>";
                  print "<option value="1" selected>Active</option>";

Its fairly straight forward, basically the option that is automatically selected needs to be the one coming from the database $modify_row[21].

View Replies !
How To Pass This Accross.. (just That $author Variable Only) Can't Seem To Be Able To Pass That Across..
i have a html form that passes a variable to first.php
($author = $HTTP_POST_VARS ['Author']

i have another php file (second.php) that needs that $author variable to be passed to..

the problem is that i don't really know how to pass this accross.. (just that $author variable only) can't seem to be able to pass that across..

i would use the include("file.php) syntax in the second.php file although the first file creates a directory at the beginning of the file every time so that makes it difficult..

ive tryed using a function with no success, but i put that not working down to incorrect syntax...

View Replies !
List Box In Form Returns Index Number Not Value Of Selected Item
I have a form that contains a list box that is filled by an array. When the form is submitted, it returns the index number of the selected item of the array of items in the list box, not the value. The value is what I need, not the index number of the selected item. Code:

View Replies !
How Do You Pass A Value From A Drop Down List?
I am completely new to this. I don't understand how to receive a value from a drop down list <select> menu. I have read many tutorials and none of them explain the process of receiving the sent data.

View Replies !
Drop Down Boxes Selected Value Against Variable
I have some drop down boxes being populated from a table:

print"<td><select name=project>";
if($project=mysql_fetch_array($pro))
{
do{
print"<option value='$project[proj_name]'>$project[proj_name]";
}
while($project=mysql_fetch_array($pro));
}
else{}

Now my question is, how can i make the value that is selected equal to another variable ie: $myrow[project], upon loading. Any ideas?

View Replies !
How To Create A Combo Box And Store The Selected Value In A Variable
does any 1 know how to create a combo box and store the selected value in a variable say $x? 

View Replies !
Store The Selected Checkbox Values In A Variable Or An Array?
how to store the selected checkbox values in a variable or an array?

View Replies !
How Do I Change The Drop Down List So The Option Selected Last Time Is Then The Current One Shown In The Drop Down Box?
I have a drop down list with the town options 'Bury' and 'Ipswich' as
shown below.

When selecting one of the options, its value is passed to variable
$townsearch.

How do I change the drop down list so the option selected last time is
then the current one shown in the drop down box?

<body>

<?php $townsearch = $_get['town']; ?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">

<select size="1" name="town">

<option>ipswich</option>
<option>bury</option>
&nbsp;
</select>&nbsp;

<input type="submit" value="GO" />

</form>

View Replies !
Make Selected Option Stay Selected In A Combo After Submit
I have 3 comboboxes, one for the day, other for the month and another one for the year. Every time i select a value for the three of them and press the "Submit" button, they reset to the default option. Anyway this can be solved?

View Replies !
Set The Session Variable To Read The Session Variable In The Next Page.
I have a PHP web app, that runs with Register global off. It sets $_SESSION variables that are used in other pages. The script works fine on my server that runs Apache2 and PHP 5.0.1.

But when I move the scrip to my hosting company that runs , IIS and PHP5.0.2, they don't work. It seems that its not able to set the session variable to read the session variable in the next page. cvWhat should I be checking ? Has anybody faces this situation before ?

View Replies !
How Do I Pass The Session ID Through URL?
I have a series of forms I have been working with using session ID's and
session variables.

I need to convert this to a series of forms where cookies might be turned
off so the URL needs to carry the session ID.

Question :
If I add the session ID to the URL that is passed, can I still use session
variables or do I need to change the way I code the variables altogether?

View Replies !
Pass Session
i have page1.php. it protected with session (user name & password) after one user can access to this page there is link to page2.php:

<a href="page2.php>page2</a>

in page2.php i read the session that created with page1.php then if it valid it show page2.php when i click on this link page2.php cann't showes because there isn't session.

View Replies !
Pass A Variable Through A URL
I am trying to pass a variable through a URL eg. index.php?page=Features. Sadly, I used to do this in the Global off environment of PHP Nuke, and now have to cope with Global on. I have tried PHP Code:

View Replies !
Pass Through Variable
I'm trying to create an image gallery, with (of course) for every
picture
the same javascript-pop-up. Because i use the same javascript, i only
want
to tell it the number of the image... Below is what i have, and it
works:

<?php $pic="01";list($width, $height, $type, $attr) =
getimagesize("./pix/$pic.jpg");
echo "<a href="javascript:MM_openBrWindow('foto.php?naam=$pic&pic=./pix/$pic.jpg','dames3','width=$width,height=$height') "><img
src="./tmb/$pic.gif" height="90" width="90" alt="$pic"
/></a>";
?>

But when i copy it, and change $pic="01" to $pic="02", i get an error.
(Which
makes sense) But how can i tell the same script to take another
number..

The best would be something like <?php $pic="01"; print $script;
$pic="02"; print $script;
etc...
?>
$script would be everything of the earlier mentioned coding except for
'$pic = "..."' So you'd have to include it, but i can't even get that
to
work.. (I can't find a way to include php-script by calling it: echo
$script)

View Replies !
How To Pass A Variable ?
I use PHP with WML. After a simple form (login & password) I check if they are correct (with MySQL) and if yes:

echo ("<card ontimer="lesson.wml">n");
echo ("<timer value="30"/>n");
echo ("<p> Password ".$pass." accepted for login ".$find." </p>n");

what I want is to the next page lesson.wml the variable $find to exist with the value it had here. Meaning I want to keep the login name to the next page. How can I do that??

View Replies !
Pass A Variable?
I have two php scripts. I need to communicate with each other. I am an Action Script developer so i AM php RETARDED. This is my first one that takes my flash variables creates the right directory then write a text doc to it. Next the user is uploading a file. I want that image file to save to the same directory as the text doc wrote too. The only copmplicted part of this is that the user names the directory Code:

View Replies !
Pass The Variable
I'm just doing a test to see if I can pass the variable "mike" from page to page. I can echo it out on 2.php but not on 3.php. What am I doing wrong?

<html>
<form action="2.php" method="post">
<input type="hidden" name="id" value="mike">
<input type="submit">
</form>
</html>


<html><form action="3.php" method="post">
<?
//$id=$_POST['id'];
echo $id;
?>...

View Replies !
I Need To Pass A URL As A GET Variable.
I am developing a site containg many autogenerated pages which contains long URLs. Some times i need to pass URL of the current page to another page when submitting a form. If I used the PHP_SELF variable, only the page's file name is passed and it not contains any variable that i am having in my current page, For example say if this is the URL now iam in Code:

View Replies !
How Can Pass A Variable?
I am trying to understand how I can pass a variable, such as $message="Login Failed - Please try again" to another header redirected page, and echo out the variable on the new php page. How does one accomplish such a task?

View Replies !
Pass Variable
I have an HTML page with a form where I have to enter a title among other things. When the user hits the Submit button, a PHP page is called where I first connect to a database to see if the title exists. If it does, I include the HTML page, but I also want to somehow set a variable to send back to the HTML page where I would check for that variable and if it's set I would output some error message like: "This title already exists. " Here's the PHP code:

//check for similar urltitle
$check = "select title from Item where title='$_POST[title]'";
$check_res = mysql_query($check, $conn) or die(mysql_error());
if (mysql_num_rows($check_res)){ include 'form.html' exit;}

View Replies !
Pass A Variable From PHP
I have made an html form with a textbox.Somebody writes there a value (something like 11) and when he clicks submit button then the number passes to a php page.There i try to pass that value to a visual basic program with something like(without sucess): html;

<input type="text" name="value">
.php
$cool=$_GET["value"];
exec('c:WINNTsystem32cmd.exe /c START c:serial.exe $cool');

serial.exe is my vb program value my variable and i use php5 Apache2 and Windows2000
I take the variable in the vb program through command line with the command Command().

View Replies !
How To Pass Session Id To Another Page?
I have a script for loggin to a site. My problem is that I want to pass the session Id to another page but I dont know how to do this. what is the correct way to pass another page the session id for security issues?

my another page is: pagina_entrada.htm in this page I have the script for checking if it is the real session id if not it is refused the page This is the script in each page belong to site. All pages has this script first. Is tthis correct? Code:

View Replies !
Pass XID Via A Session Along Each And Every Page
the user sets up the account and adds each subuser as part of his "group". they share an XID inside the database. so user XID = 001 and subuser XID=001 so i know they belong to the same group.

I want to be able to pass this XID via a session along each and every page. So one of my functions in my application would be to list all submembers with this XID. when the main user signs in, how can he carry this XID over every single page he visits? (There is no telling when the main user wants to perform the function above)

So login would include username and password, but in the background i want the XID to be passed along somehow after login. So obviously the username password and XID would be in the same table. Would i pass information in an array? how does the script know to hit this one table. I guess im having trouble putting 2 and 2 together.

View Replies !
Set Pass A Var To A Session And Set If Submitted
I have not used sessions that often and have been through a few books with limited results. Let's say I set pass a var to a session and set if submitted Code:

View Replies !
Use Session To Pass Some Variables
i have two phps..... products.php and overview.php

im tryin to use session to pass some variables from products.php to overview.php and whatever i try only the first variable gets set whereas the rest of them do not! Code:

View Replies !
How To Pass Session Value Across Pages?
have a form which have to pass through other pages and display on that page.How can I achieved it? For the first page,here is the script for session value:

<?php
    session_start();
    for ($i = 1; $i <= 3; $i++) {
    $_SESSION['selected'][$i] = date('D d h M', strtotime('+' . $i . ' days'));
    echo '<option>' . $_SESSION['selected'][$i] . '</option>'
    }
   
?>

After user selected the date,page redirect to second page and display the selected date.

View Replies !
Need To Pass Variable To Another Window
I have a dropdown on my intranet that list all of our referral partners so when I enter a client I can select who referred them to us. Well, things have been going well and this dropdown now has 200 entries to select from. It is getting tedious to go through all of these, so I was thinking of a way to search them by poping up another window for the search and when the partner is selected it will go in a text field or something similar. However, I have no idea how to pass the variable in the popup window to the regular browser window. Anyone have any ideas on how to do this?

View Replies !
Pass A File To A Variable
if i have template.html, how do i get it so that $whatever = "template.html"; i tried $whatever = file("template.html", "r"); then when i say print ($whatever); it just sez Array.

View Replies !
How To Pass A Variable From One Script To Other
Into script1.php I have a variable ($myvariable); I need to pass this variable to script2.php.

View Replies !
How Do I Pass A Variable Outside A Function?
I'm building a form with php validation, and I'm quite pleased with what I have thus far, but I have a problem - I can't get it to stop! When there are errors in the form it works beautifully, highlighting the missed fields while retaining the info in the filled-in fields. But if there aren't any errors, I can't get it to take the next step and insert the values into MySQL database. PHP Code:

View Replies !
How Can I Pass Variable To Next Page?
I have a search page to search the database, the input from user are include 4 items:

keywords
country
catalog
date

the results are divided into pages by date desc, so there are PREV10 1 2 3 ... NEXT10 to indicate the page number. Then, How can I pass the 4 items and the page number to next page? I don't wont to use urlencode() and urldecode() because there will be long url in IE's address. I try to set the $HTTP_POST_VARS as cookie, so my code:

View Replies !
Pass Variable To Another Page
i know i can pass a variable with POST or GET. but i want to do the following:

a user enters wrong login credentials, so i redirect the user to error.php.
but i also want to pass the message "login credentials not found!".
I could do this with: header("location:index?php?page=error&err=wrong login credentials");

but i don't want the error string to be visible. can i do this another way?
POST doesn't seem an option to me as there isn't a form involved.

View Replies !
How To Pass A Php Variable To Exec()
I am trying to do the following :

exec ("echo $mail_body | /usr/sbin/sendmail - v achandak@cse.buffalo.edu");

where $mail_body is my php variable...But this only sends out a blank message. The contents of $mail_body are not appended to the message.If i am not wrong, i think we can pass a php variable to exec(). But maybe i am not doing it in the correct manner?

View Replies !
How Do U Pass Variable Between Pages?
I am using windows nt and trying to enter data in a form on one page and then send it to another page to be displayed.

The problem is Page one works (entering the data into the forms and sending it) but when it gets to page 2 the data does not display. I am using 'method=get' and the data i entered on the form appears on the url but not on the page. For example, the name entered in page 1 is stored in YourName and should be displayed when i use the following code:

Hi <?php print $YourName; ?> .

However all that is displayed is "Hi ."

Does this sound like a common problem or not/ Any ideas how to fix it?

View Replies !
Pass Variable To Another Script
I need to pass a variable from script1.php to script2.php. The problem
is that these scripts use frames and therefore I am able to pass the
variable through the URL. It also does not use forms to set this
variable, so i cannot pass it this way either.

So to simplify I have :

script1.php
<?php
$var1 = value;
echo '<href="script2.php">link to script2</a>'
?>

script2.php

<?php
echo $var1;
?>

How can script2 find this value?

View Replies !
Declare Variable To Pass To Php
I have a check box on page 1 of an html page with no submit button.
There is a list of links that call a php display page from page 1.

I want to check the status of the check box from the display page but I
haven't found a way to pass the value without a submit function.

View Replies !
Pass Variable To Xpath?
I am trying to find out if there is a way to pass a variable $fquote to
xpath ...[qtnum="help"]
$fquote would be derived from a form.

<?php
$s = simplexml_load_file('fishquotes.xml');
$fquote = "245";
$findquote = $s->xpath('/fishingquotes/quote[qtnum="260"]');
....?>

<?xml version="1.0"?>
<fishingquotes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<quote>
<qtnum>101</qtnum>
<title>Small Fish</title>
<copy>Govern a family as you would</copy>
<copy> cook a small fish; </copy>
<copy>very gently.</copy>
<author> Chinese Proverb</author>
<comment>None</comment>
</quote>
<!--and 450 more quotes-->
</fishingquotes>

View Replies !

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