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




Array Values Not Passing To Next Page


I have a search form which has list box where in the user could select multiple values and a text box for date field.When the user selects multiple selection, the query works fine and displays according to selection only on the first page, but when they hit the next page the query displays the results for all selection.

I 'm displaying 25 records/page. But it works fine for the date field and the next , previous links display according to the date value. I 'm not sure why the value of the array is not passed. PHP Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Passing Checkbox Values To Another Page
What I want to do is pass multiple checkbox values from a form on an HTML page to another page (Thank you page) where it can be viewed if it was selected (checked). I know I need to "Get" the information from the quiry string after the information has been submitted but I'm lost on how to exactly set this up so it works properly. Code:

Passing Array Values In Url
I want to pass an array to another php script as follows: Code: echo "<a href="./xxx.php3?value_list=$value_list">xxx</a>"; What would be the correct way to do it?

Help Needed - Passing Values Between Two Loads Of The Same Page
How do I pass a string from one call to a php block to another call in
the
same page but from another form?

Here's my full php code:

I'm using two forms in the same page. A hidden field 'f' with values
&#391;' and
&#392;' are used to distinguish calls from one form from those from the
other.

<html>
<head><title>Database Access</title></head>
<body>

<form name="QueryForm" action="db2.php" method="POST" />

<input type="hidden" name="f" value="1" />

<input type="text" width="100" name="txtQuery"
value="select * from license_master;" /> <br/>

<input type="submit" name="Query" value="Query" /> <br/>
</form>

<?php
$s = ""; $nl = "<br/>";
switch ($_POST['f']){
case &#391;':
$conn=odbc_connect('mysqldsnone','root','katipatan g');
$sql = $_POST['txtQuery'];
$rs=odbc_exec($conn,$sql);
echo "<table width="60%">
";
while (odbc_fetch_row($rs)){
$abbr=odbc_result($rs,"abbr");
$fullname=odbc_result($rs,"fullname");
$link=odbc_result($rs,"link");
echo "<tr>
<td colspan="3" background="blue.png">
<p class="white-text">".$abbr."</p></td></tr>
";

echo "<tr><td>".$abbr."</td><td>".$fullname
."</td><td><a
href="".$link."">".$link."</a></td></tr>
";

$s .= $abbr.",".$fullname.",".$link."
";
//making the comma separated string here
}

HELP! Passing Checkbox Values To Array
I have a form with a repeating table display data from MySQL, ie, invoice numbers and invoice pricing.

I need to be able to select which invoices someone wants to pay via checkboxes. From here, I need to be able to display the corresponding records on another page where I can SUM() the invoice totals to give a price to be paid.

I've never used array's before but believe this is how it should be done. My brain is currently fried and I'm struggling...

Passing Array Values From PHP To Javascript
How can I pass an array called $n[] to javascript?

Passing An Array From One Page To Another?
Is it possible to pass an array from one PHP window to another? I have a form where some choices are made by checking boxes, a large number of boxes. And the results of the checks are held in an array. I would love to have the resulting query populate a new pop-up JS window, but I cannot figure out how to pass an array.

Confirmation Page With Multidimensional Array Values
I was hoping someone could help a newbie with a script I'm trying to write. I have an HTML form that uses a multidimensional array to generate a select box. The array is as follows: Code:

Passing The Values
The file name is visit.php

I have a search option and
1) user will give a value
2) the page will search and give the output.

Now i want to pass the values to another <?PHP ?> code which is inside the the same file in visit.php

ok here is the example Code:

Passing Values
The problem is that I have 3 different pages (classic, business and VIP) which links to the contact.php page
and in these 3 pages there are 3 different banners, menu and footer. And in the (3) footer file there is one common link to the contact page

what i did was from the Classic footer i passed this value
<a href="contacts.php?frompage=Classic" class="bottom_link">contact</a>
and from the business footer i passed this
<a href="contacts.php?frompage=Business" class="bottom_link">contact</a>
and from VIP footer i passed this
<a href="contacts.php?frompage=VIP" class="bottom_link">contact</a>
and in the contacts.php page i did this
<?php $mypage = $_REQUEST['frompage']; ?>
and from this variable i managed the header, menu and footer
<?php 
if ($mypage=='Classic') 
{
include("includes/header_classic.php"); 
}
elseif ($mypage=='Business') 
{
include("includes/header_business.php");
}
elseif ($mypage=='VIP')
{
include("includes/header_vip.php");
}
?>
same code follows for menu and footer

But what happened is when i Submit the form and save the information in database (all the values) gets saved, the header, menu and the footer gets lost...

I know because while submitting $mypage variable gets blank and due to this the headers are not showing, how shall i retain the value from this variable while i submit the form or the page refreshes.

Adding New Values To An Array That Already Contains Values..
is it possible to append new values to an array that already has values in it??

say, i have my existing array;

existing array;
$array = array([66314] => 66314 , [66315] => 66315) ;

then , when i check my checkbox on my next page, the ids should be appended to the $array:

array that needs to be added to the $array;

$array = array([66316] => 66316,[66317] => 66317,[66318] => 66318);

how should it be done??

Passing Values Between Forms In Php
why is it that i am not able to pass all the values i used in php 4.2.1? my codes are running smoothly before i upgraded my php. the codes are the same since before but only i change the directory of the apache server form /usr/local/apache/htdocs to /var/www/html.

is there i need to configure so that i can run my programs smoothly again?
for example i have this line in one form:

<input type="hidden" name="empno" value=<?=$empno?>>

and when i pass it to another form, there is no value that is passed in $empno.
how can i correct it guys?

Passing Values To Drop Down Box
I have a database of contacts setup. one of the options is for new people to add their own information to the database. So some of the fields (such as Department) are added via a drop down box of values.

However, users also need to be able to edit their information at later dates... When they do edit their information, there current record is shown in editable text form elements. The problem I am having is: how can I make it so that when the users edit the information, the drop down box is already at the correct option. I have no problem with the stardard text boxes, its just the drop down boxes that are giving me grief.

Passing Values Between Scripts:
I wondered if anyone could offer some guidance over my php script. I
was hoping the example would allow the user to click the submit
buttons and the item number increment.

And when the user clicks, the my basket icon the items.php scripts
starts and the variables from the current script are passed to this.

I tried to display the variables as the items are incremented, though
I got no value. Can anyone see the logical error?

<?php
global $item1, $item2;

if(isset($_GET['item1'])){
$item1++;
}
if(isset($_GET['item2'])){
$item2++;
}
?>

<head>
<title>PHP Example</title>
</head>

<body>
<p>
<table border="0" width="100%">
<tr>
<td>
<a><img src="mybasket.jpg"></a>
</td>
</tr>
</table>
</p>

<form method=post>
<table border="0" width="79%">

<tr>
<td>
<input type="submit" name = "item1" value = "Add item1">
</td>
<td>
<input type="submit" name = "item2" value = "Add item2">
</td>
</tr>

</table>
</form>

</body>
</html>

Redirect And Passing Values
I'm working on having a DB that stores video's with the web location. Then, it will use the location in a html file to load an embedded media player to play the file. However, i'm new to PHP so i'm not exactly sure what to do. I'll include the code that i have at the moment and try to explain what i'm doing.

The "playfile.php" is the first below. (hopefully this is correct but...) It connects to the database and makes a displayed link of the video names in the DB (through the else statement because the if is false the first run). Then, depending on which link you click, it runs the initial if getting the location of that video.

Now, i need it to load an embedded media play playing the file for the video. I had this in a second php file that i needed to pass the location to. This is where i have problems. I do not know how to load up the new page, send the location, and have the location as noted by "filelocation" in the second part below. Code:

Passing Values From A Form
I want to know how can i pass values from a html page/form(php) to an applet i.e the values obtained from the form is used as parameters in the applet.

Passing DB Values With A Space In The URL
I have written a web app that takes results from an Informix DB. this DB is part of a legacy system and as such, I cant change the data in it. i am only writing something that outputs the data.

One of the DB fields holds placenems and these in some cases are two words ie: San Diego. Now, there is a second page which produces further results depending on the placename. I pass the placename value to the next page in the URL but, and here's the problem: Normally, I pass the value like so: link.php?name=$placename If the placename is Dublin then the link would be PHP Code:

Passing Variable Values With The Url
I have made a simple php script that multiplies two variable x and y. x and y are both the value of 0 and when I run the script the result is 0. I then changed the value of x and y to x=3 and y=5 and my answer was 15. All these tests prove to me that the php is working on my Xitami server.

I then tried to enter the values for the variables through the url but it doesn't change anything on the browser, I mean I keep getting 15 even after I entered x=1 and y =2 on to the url.

Passing Values From Php To Program
I am trying to pass some values from my php script to a program running on the server. The program takes the values as the POST method.

Passing Values From One Script To Another
What is the easiest way to us the include command to go to anexternal script.

The script does some stuff but here is what need:

When i have completed the external script, I am currently using this:

@header("Location: ".$_SERVER['HTTP_REFERER']);  to get back to the page that called the external script..

can i use this command somehow to pass variables from the external script to the main script? If not, is there another command that i can use return to the main script while passing variables?

Passing Values To Two Variable
I want something like this

$a //query the table "Library" (but i want the value of $b)

//inserting data into table "Library" database

$b //after query "Library" table the output
So i want the value of b to the a (mean value of $b and $a is same) so how to pass the value of b to a?

Passing PHP Variable Values To A <textarea>
Having problems passing PHP variable values to the <textarea>? Solution: Create a Javascript function and execute it once the page loads. Useful when loading data from the database to the <textarea>. Code:

function textarea_value()
{document.[name of form].[name of textarea].value = "<? echo $data; ?>"}

Note: Tried passing array values but failed. Workaround is to assign value to a regular variable.

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...

Passing Drop-Down Values Between Forms
I'm trying to pass a drop down value on a form on one page to a form on the next page and haven't figured it out just yet.  I know I'm missing something, just not sure what. Here's the simple dropdown: Code:

Passing Variables/values Out Of While Block
I try to populate an array variable by pulling data from data using while. However, whatever I insert only stays in the while loop. I need the values to be available outside of the while loop. Below is the code...

$chart['chart_data'][0][0]="";
$chart['chart_data'][1][0]="Opens";

$sql = "SELECT count(*) as open, sdate FROM table a where nl=111 and lid=863 group by sdate order by sdate ASC";
$table = mysql_query($sql) or die("cannot select");
while($row=mysql_fetch_array($table)) {
   static $i=1;
   $chart['chart_data'][0]['$i'] = $row['sdate'];
   $chart['chart_data'][1]['$i'] = $row['open'];
   $i++;}

SendChartData ( $chart );

Passing Multiple Table Values
I have a products table that I have created from a query, but I need to update the information based on quatity. What I am confused about is how to pass the multiple values to another page when they have the same variable names. Code:

Selecting Array Rows Based On An Array Of Field=>values
Here's the code i have:

$db = array(); //main array
$db['main'] = array(); //table `main`
$db['main'][] = array('id'=>0,
'username'=>'joshfrench','userpass'=>'password','userlevel'=>'admin');
//row
$db['main'][] = array('id'=>1,
'username'=>'bob_smith','userpass'=>'psswrd','userlevel'=>'user');
//row

function trim_value(&$value){
$value = strtolower(trim($value));
}
function fdb_select($fields = "*", $table, $where = false, $limit =
false){
global $db;
$retv = $db[$table];

//LIMIT RESULTS TO FIELDS
if(strrpos($fields, ",") === false){$field=array($fields);}else{$field
= explode(",", $fields);};
array_walk($field, "trim_value");
$all_fields = array_keys($retv[0]);
if($fields == '*'|| is_null($fields)){$field = $all_fields;};
$field = array_uintersect($all_fields, $field, "strcasecmp");
$retvi = array();
foreach($retv as $num =$row){
foreach($row as $fname =$fvalue){
$fname1 = strtolower($fname);
if(in_array($fname1, $field)){
$retvi[$num][$fname]=$fvalue;
};
};
};
//DONE LIMITING TO FIELDS
if($where != false){

//UP TO HERE IT WORKS FINE
//LIMIT TO WHERE CLAUSE
$retvj = array();
foreach($retvi as $num =$row){
//IN THE ROW
foreach($where as $k =$v){
//IF ROW MEETS ALL REQUIREMENTS
if($row[$k] == $v){
$retvj[] = $retvi[$num]; //Keep that row
};
};
};
//DONE LIMITING TO WHERE CLAUSE
};
$retvi = (isset($retvj)) ? $retvj:$retvi;
//SEND A FINAL ASSOCIATIVE ARRAY
return $retvi;
};
print_r(fdb_select("*", "main", array('id'=>"1",
"username"=>"joshfrench")));

the previous code outputs this:

Array
(
[0] =Array
(
[id] =0
[username] =joshfrench
[userpass] =password
[userlevel] =admin
)

[1] =Array
(
[id] =1
[username] =bob_smith
[userpass] =psswrd
[userlevel] =user
)

)

Keeping Lots Of Values From Page To Page
I am doing an online questionnaire which is going to have 5 questions per page and upto 100 questions.

If somebody hasn't completed the entire questionaire I do not want their data stored in the DB. I was wondering if anybody can tell me the best way to either use sessions to store the data and do a final update at the end, or use a temporary db table to hold the data.

Passing Checkbox Values Into The Correct Arrays
I've been looking at some code and the net for the past few hours trying to figure out what's wrong and I'm stumped. I have a form - multiple checkboxes (different names) and text fields going into an array. The text fields behave fine - the values from the first entry will populate elements of the first array.

The weird part is that the check boxes will pass the correct values but not always to the correct array element. For example, given two check boxes in a 2 element array, if you check the 1st box in the first element and the 2nd in the second element, on submission, the second element populates the first array element.

I've included a snippet of the code as an example - it's echoing things like crazy because I've been trying to see what's been going on. I hope someone can figure this out for me 'cause I'm completely stuck and am on a deadline. Code:

Passing Values Using Drop Down Menu To Same Form.
how I am able to do this without the use of a "submit" button - ie onchange. Here is what I am working with.

<form name="form1" method="post" action="">
<select name="MyNumber">
<option value="One">One</option>
<option value="Two">Two</option>
<option value="Three">Three</option>
<option value="Four">Four</option>
<option value="Five">Five</option>
</select>
<input type="submit" name="Submit" value="Submit">
</form>

<?php @print ($MyNumber);?>

Passing Values Via <a Href="http:// Etc
I have learnt how to pass values to a new page using forms but now I would like to have my user click on a simple '<a href ...' link and pass a value to the new page.

Passing Variable Values Between PHP Scripts ViaPOST
I've tried
reading online PHP docs but have so far been unable to discern the solution.

I have a PHP form 'foo1.php' that calls a second form 'foo2.php' via a
POST operation. I want the value of a variable $n in the first script
to be visible to the second script. What is the correct way to do this?
Do I need to pass the value of $n as a hidden form variable? Or can I
simply use a call to GET_HTTP_VARS, _REQUEST, or _POST inside foo2.php
to access the variable? So far my experiments with the above methods
have failed, but maybe I'm not doing it right.

Echo Problem Passing Values To A Function
I wish to echo some values to a javascript function here is my script. passvar() is my javascript function.

echo '<tr id="action" title="Click to display sites below" onclick="passvar($pageNum,$id,$name,this );">';

Passing Values To Constuctor In Object Oriented?
When I make an object, can i use some sort of parameters to pass values to the constructor? If not, what can I do to "Set value X when its created" (value X= member variable) Code:

Passing A Parameter From An HTML Page To A PHP Page
I want to pass a language value (EN/FR/DE etc.) from an Index HTML page to a PHP page with a language code in the call, so that the PHP page can select texts in that language. I would like to to it from an unordered list item if possible by extending the link ... <li><a href="scripts/pricelist.php???>Pricelist[/url]</li>

Passing Values To One Site And Retreving That Sites Response From
I want to check a phone number exist or not. For checking this there is another site developed by some body else. In it two boxes for entering code and number and button for submitting. If the number exists site shows  one message and if not another.

My problem is that I also have the fields and submit button in my site, how can I post this values to the number checking site and retrieving values from that site. I want to show the retrived messages in my site..

Modifying Values In An Array And Then Putting Them In A New Array
How do i get values out of an array, modify them and then put them back into a new array.
I have tried using a foreach to get the values out and to edit them but i don't know how to get them into a new array. Here's the code:

Passing Array Of Multidimensional Array To Function
How do I pass a part of a multidimensional array to a function. I have the following (in pseudo):

$arrays[m][n]; // filled with values
$chosen = 3;

function doSomething($array) {
 // do something with 1D array
}

This fails:

doSomething($arrays[$chosen]);

Can someone explain to me why? And how to do this right?

Array (add More Values To The End)
I have an array. I wan to add more values to the end of the array. how would i go about doing this. my current code does not work. PHP Code:

Relocating, But Placing Values In The Page
Ive got a script that simply redirects, however cpanel has placed a password on it.  ie password directories function. I wanted to gether that password, and then have it placed in another set of username and password fields, on the recirected page.  it would be best if it can use multiple passwords etc to gain acces,,, ie multiple users.

In php, can i get those Cpanel gathers usernames and passwords? and/or can i use php to place values into a form, not on its directory?

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.

[HELP PLEASE] Passing Variable To New Page
I am having hard time passing the variable to the next page. May be you can help me. Let me explain:

I am using mySQL database to store information about images (ID, name, author, description, etc). I am pulling some of the information to create this (look at the example here: http://www.gibsonusa.com/test/page/index.php) Now, I want a new window appear when user clicks on the image. I have achieved it with the following script:

echo "<script language="JavaScript">";
echo" function pop1() {";
echo" window.open("info.php?prod_id=$result[0]"); }"; $result[0] is variable that stores id of the image in database
echo "</script>";

I am calling this function in the following manner: echo"<img onclick="pop1();"";

You can see the result if you click on the image. The new page opens up, BUT the id (product_id in this case) value is not passed to the next page correctly. If you click on the first or second image on the first page it shows that the ID is the same for both of them. However if you look at the source code you can see that the ids are assigned correctly. The same thing happens if you click on any image that says “no image available” (I am using different script to generate those). It seems that the script picks up and stores in the memory the value of an ID of the last image generated with the script (I don’t know if that make sense).

Oh, by the way the contents of info.php that I am calling in the script above are as following:

<?
$myid = $_GET['prod_id'];
echo" Product ID: $myid<br>";
?>

What am I doing wrong? Can you help?
Thank you.

Passing JSP Vars To PHP Page
I need to pass 2 variables that are calculated in thru a few JSP pages and I would like to place the amount calculated into a PHP page.

Passing An Image From One Page To The Next.
I want the user to input information, submit it and be able to check it before having it go to the database.This information will include an image.How do I pass the image from the input page to the next page before having it go to the database?

Passing A Variable To A Page
Is it possible to pass a varialble to a page using just PHP/HTML. The object is to create a agenda page, with information comming from MySql, based on the choise of month in the index page in a different frame, i.e. the month is selected in frame 1.

Now i want to sent the choice of the user to a page, to be shown in frame 2, that is created with PHP, and use the variable in the MySql query.I know this can be done using java, but i would like to avoid that.

Passing Result To New Page.
I have a search result with a link which links to the ID# of the record. By clicking on the link I would like the rest of the record displayed. What will my script look like to pull a particular record ID?

Passing Strings To Another Page
when this code sends the category to the next page it only sends part of the information.. ex… if the selection consist of 1 word its fine but if it consists of 2 words it only sends the first word >>>”network card” sends the word “network” and not “network card” and if its “monitor” and since its 1 word its fine..

What am I doing wrong.. I’m kind of new to php and if you could let me know it would be greatly appreciated. I think my confusing is with the format of this line perhaps where the quotes and slashes go, not sure. Other wise this code does work. I can see it in the address field that it separates the selection but need to send the whole thing as 1 word.

<php
echo "<a href="displaylist.php?cmd=".$row["CATEGORY"]."">". $row["CATEGORY"]." (".$row["ENTRIES"].")</A>";
?>

Passing Big Arrays To Another Page
I'm having a little problem on my advanced search system with large amounts of results, when trying to pass them to another page. Tried to use the serialize function but when the results reach a number, for instance, of 300 the link will not handle that. It works for small resultsets.

When user search the database for (example) stores in "New York" we get 256 results.
Now I want to give the user the chance to search on these results, the stores found in the former query that sell "bread", which would take the user to another page called "advanced search for store features".

This to avoid the use of big forms for these advanced searches, where I've created a degree set of search pages (I have about an overall 250 features to search).

The main problem seems to pass the array to the other page when large ammounts of data are set on this array, which I'll call here as $storeIDs. When the results are small, the serialize and unserialize function will do the job. Is there a way of going through this in other manner?

Passing More Than One Variable To The Next Page?
I've got a page with product info on it. The same page also has a recordset of variables.
I've got a button which has been written using php something like:

<? print"<a href="write_review.php?PID=$product_id">img etc...?>

and I've got $product_id = $_GET['PID']; at the top of the page! This passes the product ID to the next page so that I can use it! How would I pass another variable too using the same button? I've tried just adding &title=$product_title, but it doesn't seem to work?
I've already got $product_title = $_GET['title']; at the top of the page under the first one.

Passing The Variables To More Than One Page
I have an initial page 'page_one.php' that sends the data to another one - 'page_two.php' using form. It sends a couple of variables collected from the user input. Now....'page_two.php' has header function before any html that is either skipped or executed based on the user selection. If it doesn't come to header everything is fine, but if it does - header redirects 'page_two.php' to 'page_three.php'.

Now, I want to be able to view all the selected variables in 'page_one.php' in my php code in 'page_three.php'. In another words, how do I pass the variables to page_three.php if it's not declared in action='...' located in 'page_one.php'?


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