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.





Pick And Choose List


You have two list boxes on a page. On the left are all the choices, the right box is empty. In the middle you have "arrow buttons". A single one pointing right says "move the selected choice into the right box".

A single pointing left does the opposite. A double pointing right says "move all choices from left to right". A double pointing left does the opposite.

I am not sure if I can do this with PHP. Maybe Javascript? Or is it just impossible to do with web pages?




View Complete Forum Thread with Replies

Related Forum Messages:
How To Use A Value From A Pick List?
I'd like to have a form that does the following:
User picks a site from a dropdown list from a MySQL db (that works -
code below, thanks to all those on the web who posted code for this).
Once the value is selected, a second query is run using the site as the
'where' clause and the results are displayed back to the user.

mysql, php, htlm noob. I think once I get this bit,
I'll be able to move forward with more interesting and complex code.

ps - if this message shows up 3 times, my apologies but I've been having
trouble posting.

<html>
<body>
<?php

// connect to db
$db = mysql_connect("localhost");
mysql_select_db("test",$db);

// build query
$sitequery = "SELECT site from sitedata order by site";

// generate result set
$siteresult = mysql_query($sitequery);

// use results
echo "Select a site from the list below: <br><br><select name='site'>";
while($siterow = mysql_fetch_array($siteresult))
echo "<option
value='".$siterow["site"]."'>".$siterow["site"]."</option>";
echo "</select></td>";
?>

</body>
</html>

View Replies !
Dynamic Pick List
I have been developing programs in perl and oracle and have recently switched to php. I need to create a form that has four of five seperate pick list on it. Each item in each of the pick list depend on the users previous entry. For instence if the user picks Ford then Taurus, Ranger, Focus,.etc show up in the next pick list then the user picks Ranger and 2 wheel drive, 4 wheel drive, etc show in the next pick list box on so on.

I know how to this if the screen is refresed after each user entry. What I would like to fugure out how to make the screen automatically update each pick list and not refreshing the whole screen.

View Replies !
Allows Someone To Change The Given Attribute Via A Pick-list
I have a form that lists query results (members, attributes) side by side, and allows someone to change the given attribute via a pick-list. I'd like to know how all of the member attributes (one for each member listed in the query results) can be updated at once. I have no problem implementing this when just one record is being updated, but as soon as there is more than one record I get into trouble. Here's a little diagram of what I'm trying to do:

------------------------------------------
Name | Attribute
------------------------------------------
Member1 | Pick List
Member2 | Pick List
Member3 | Pick List
" etc " | " etc "
------------------------------------------

| Update |

View Replies !
Identifying User's Pick From Selection List
I have an application that uses PHP to access a MySQL table and
extract rows which match the user's search entry. Data from the
matching rows are loaded into an HTML selection list, and the user can
scan the list and highlight a selected item.

My question: In PHP, what is the syntax for identifying which row is
highlighted?

My goal is to pass the unique row ID of the selected item to a
subsequent form where all the fields will be displayed for the user to
edit.

I already have the code that loads the selection list and the code
that displays the fields. I just need to know how to determine the
highlighted item.

I have two PHP books, and both discuss loading the selection list, but
there is no mention of what to do next.

View Replies !
Pick From A Drop Down List That Automatically Gives Options In A Second Dropdown Box
does anyone know how to create a form that allows the user to firstly pick from a drop down list that automatically gives options in a second dropdown box. eg.

'category1'
is selected from dropdown box 1,
this then populates dropdown box 2 with the options
'category1.a' or 'category1.b'

or if
'category2'
is selected from dropdown box 1
then dropdown box 2 gives the options of
'category2.a' or 'category1.b'

i f any one knows how I should code this please help, if not point me in the direction of a tutorial that can.

View Replies !
Choose Random Item From List But With Different Weighting
I want to choose an item at random, but have different probabilities for each item. One easy way is just to create an array like

$a[]=1
$a[]=2
$a[]=3
$a[]=3

That way a random number between 1 and 4 would give the weighting I want, but it seems like there has to be a much smarter way to do this. I've seen some algorithms for random distributions, but they don't quite do what I want. Oh yeah - must not require a DB; this should work with values from a CSV or similar ...

View Replies !
Pick Up Page Name In PHP?
Is there a way, within a PHP script, to pick up the name of the web page that the script is being run on?

View Replies !
PHP To Pick A Table
In my attempt to be more organized I setup my database like this: DB:

-Table1
-Table2
-Table3
-Table4

and each table has 4 forms for information.

View Replies !
How To Pick The Closest Number
I've been wondering about this for a few days.

I have an array containing 4 numbers:

$listofnumbers = array(0,15,30,45);

Then there's a variable that could contain any number between 0 and 59.

$actualtime = date('i');

Using the above I want to find out which of the numbers in the array is numerically closest to the value of $actualtime. So

if $actualtime = 34 then I want to return the number 30
if $actualtime = 11 then I want to return the number 15 etc.

I'm sure there's a simple solution but can't figure it out.

View Replies !
Gmail Does Not Pick Up Sender Id
I had a shared hosting account with Godaddy earlier. I have script in my code which sends automatic emails to users when they sign up on the website.

All these emails were going in a proper format earlier. When i changed to Virtual Dedicated Server on Godaddy, emails which are automatically being shot to yahoo, hotmail or any other accounts are going properly. Code:

View Replies !
Pick Records Between Dates
I have this table

   id_hotel    |    ratesin      |  ratesout      |    rate
       1         | 2007-06-07   | 2007-07-15   |   100.00
       1         | 2007-09-07   | 2007-12-10   |   150.00
       2         | 2007-05-07   | 2007-08-10   |   150.00
       3         | 2007-04-07   | 2007-09-10   |   120.00

What I want to do is to make a selection and show only records between desired dates, example:

If I post via form: id_hotel = 1 ratesin=2007-07-07 and ratesout=2007-07-10, the result will show only the records in those dates range in this case the result will be:

   id_hotel    |    ratesin      |  ratesout      |    rate
       1         | 2007-06-07   | 2007-07-15   |   100.00

Maybe is easier than I think, how to achieve this.

View Replies !
Need A 'pick A Date' Script
where I can find a good, quick, clean script to provide a calendar from which the user can pick a date to populate a field? Ideally Im looking for a small pop-down as aprt of a larger page wide data form.

View Replies !
Checkbox Problem, He Always Pick The Variable Of The Last One
I have currently 2 awards in the database, with this script i pick them out of the database and define if they are selected and if the user unselect it then pass a variable to the database. Now it works almost good except that the script always looks to the 2nd award(last one), if the 2nd one is unselected then it updates award 1 and award 2 as unselected, when i unselect the 1st award and select the 2nd award then he updates the database with both selected(1st one and 2nd one), so the problem is that he always listening to the 2nd(last) variable/award. Does someone have a solution for this problem because i cant figure it out, greatly appreciated. PHP Code:

View Replies !
How Can I Pick All Checked Value In Action Page?
I have a dynamic category list, I have printed those list with check box in the form. I have to check those boxes and submit. How can I pick all checked value in action page? Right now only one value passing from several check boxes while several check boxes checked. Code:

View Replies !
Pick Apart Post Variable Names
i am dynamically creating a list of checkboxes for each job title in a db.

the checkbox array names are something like 'job2quest[]' & the 'job5quest[]'...

since i dont necessarily kno which jobs will appear, i dont want to hardcode the variables when the form is submitted.

is there a way to pick apart post variable names, so the script can find the checkbox arrays?

View Replies !
Pick Number By Random Selection...
Ok I have a column with a bunch of id's in it... is there a way to gather all the id's that are there.. and then show 5 of them by somekind of random selection on each page load?

View Replies !
Search :: Read Files And Just Pick Out Certain Words
I wanted to know if there is a way with PHP to read files and just pick out certain words. For example, I have an essay paper and I want to see if with php I can find out how many times I said the word "for".

View Replies !
What CMS Will You Choose ?
I want to build a new website in PHP but also want to customize the code to what i want to do.

There is hundred of CMS different lol ! except the famous phpnuke, postnuke...I don't know what CMS choose.

It's would be a complex website with medium traffic and a lot of page with deep navigation tree.

During my course on the net..I remark some new one like AGORA SUNRISE. Did you test it ?

View Replies !
Please Help Me To Choose Which CMS
I am planning to develop one community website with the below given
features but I don't know whether I can use the existing CMS like
drupal,exponent etc or I can create with raw php.

1. Base profile building, photo addition, friends addition
2. groups
3. Online chatting
4. document upload/ download functionality
5.job classified
6. Advertisement platform

View Replies !
Help Choose CMS
I've been looking for a while to try to find a decent CMS but so far I've had no luck.

What I'm looking for is something that is easily integrated into my website.

All the CMSs that I have come across are very bulky and are not very flexible with design and static content pages.

Basically what I'm looking for is something similar to CuteNews only with more options. So for example if I want to insert news in an area on a page, i just type it in the code to include the news, and it appears there, same thing with polls, galleries, and other modules.

View Replies !
Which Version Would You Choose ?
I just got asked to setup a LAMP box for a friend/customer. I am not sure
yet which versions of LAMP I should best use.

My initial thoughts is go with SuSe Linux and all latest versions, but
especially where PHP is concerned, I am not sure PHP5 is preferable yet. I
can't really say why, just the fact it is a major new version and relatively
unknown wrt stability/security.

What would you guys choose ? (The scripts that are gonna be run on the box
aren't very spectacular I believe, oldskool straightforward stuff, a weblog,
a small db application and some home pages with mailforms)

View Replies !
Choose Randomly
how would I get this to choose a line of text randomly instead of in order so it doesn't pick the same one twice in a row? Code:

View Replies !
Which Book To Choose?
At the moment I own PHP and MySQL for Dynamic websites 2nd edition by Larry Ullman. I've read through it and done several examples. However, I personally find by creating mini websites, instead of just typing one page scripts that I learn it more. I have gone through the content management system and user management system in the book several times, using and adapting the code for different websites.

I now want to expand these examples so I can see how different people code and find the best medium for myself.

Which book of the following three would you suggest I buy?

Sams teach your self PHP, MySQL, Apache all in one
Sams teach your self PHP in 24 hours
Sams teach your self Ajax, Javascript and PHP in 24 hours
PHP and MySQL Web Development 3rd edition

View Replies !
Choose Nearest Value
I have a table which holds the integer values(the value representing some data) of many users the table look like this (MySQL):

id  f1   f2    f3
1   30  50   15
2   31  17   37
3   18  31   54
and more ....

i randomly select a user from the another table(let's call it sel_user), and then i select a user who got the numbers closest to the sel_user or same as the sel_user, from the table above. Code:

View Replies !
Random Or Choose.
In my html page, i have this:

what i want to do, is maybe something like this:

[php]
if (isset($_GET['style']))
{
$style = $_GET['style'];
}
else
{
$style = rand(1, 2);
};

But i want to define one css as 1 and the other as 2, and then i can either get to the skin by going to the page ?style=1 or by refreshing the page, and it will be random every refresh, thus giving me more skins. How can i add that?

View Replies !
Choose A Value From An Array?
All the exmaples i've come across on the internet either show you how to create or echo arrays, given that you enter the values yourself. But I need to choose a value from within an array that has 560, and I don't know the value.

So far my script looks for URLs within a html page then inserts them all into one array. When I: PHP Code:

$result = count($matches, COUNT_RECURSIVE);
echo $result;

it displays " 560 ". So how can I choose the 560th value from within the array, so I can use it? I tried $match[560], didn't work :/ Not too good on arrays.

View Replies !
Mail() Choose
When I try to send mail to my email address @SASKTEL.NET, everything works fine. When I try to send mail to my email address @HOTMAIL.COM, the mail is queued, but never delivered. Is this a server problem, and has nothing to do with my PHP code itself? I am using Free SMTP Server, because I do not have access to any other server. If anyone can recommend where I could download a good one.

View Replies !
User Can Choose Between Different Languages
I want user can choose which language they want by clicking a button or choosing from a pull down menu I have already created the two set of language files en.inc.php and cn.inc.php But I have no idea how to make this work there are two methods that I am thinking of create set cookies on the homepage PHP Code:

View Replies !
Php Framework, Which One We Should Choose ? Which Will Help Us Grow ?
I am doing a lot of php works these days. But most of the time, I
am reinventing the wheel. And thats I am not happy about.

I would like to know about the frameworks( like Zend Framework,
CakePhP), which you experts are using. And if possible, tell why you
are using them.Why some contexts, some frameworks succeed and some don't.

View Replies !
How To Choose Info From One Table To Another
I have a table called "products" in this table is a row for "color" the color row holds the id of a certain color in the "Colors" table. How would i go about using the sku from the products table to search the colors table for the corresponding colors name?

View Replies !
Using Switch To Choose Db Table
Has anyone every used a switch to decide which table a query should use?

I'm experimenting a little, and I think the following should correct?

$sql = 'SELECT * FROM games'
$gamedata = mysql_query($sql);
$row = mysql_fetch_assoc($gamedata);
$game_type = $row["type"];

switch($game_type){
case 'R1': $table = 'table1'
break;
case 'R2': $table = 'table2'
break;
case 'R3': $table = 'table3'
break;
}

$sql = "SELECT adjacencies FROM $table WHERE id = '$from_country'";

View Replies !
Using Switch To Choose Page
This is probably simple, but how do you set a variable in a switch statement to point to a specific url/page.

switch($_GET['id']) {
case 'tab1':
$content = 'This should point to page 1'
break;
case 'tab2':
$content = 'This should point to page 2'
break;

View Replies !
Choose Random Image From Dir And Display It
I have a directory of images, called "random". In it are the following
files:

1.gif
2.gif
3.gif
4.gif

I use this script to choose a random image and display it:

$i = -2; // $i = -2 so that the directory files ("." and "..") won't be
counted.
if ( $dh = opendir( "images/random" ) ) {
while ( false !== ( $file = readdir( $dh ) ) ) {
$i++;
}
closedir( $dh );
$rand = rand( 1, $i );
$randimg = '<img src="images/random/' . $rand . '.gif" />'
}
print $randimg;

This works just dandy. However, I figure there must be a more efficient way
to count the number of files in a directory. Is there a directory's
equivalent of a function like file()? Or is my script the only way to count
the files?

View Replies !
Should I Choose PHP4 Or PHP5 For My Testbed?
I'm setting up my computer again for developing websites. Logically it seems sensible to exactly mirror the version of PHP on the final web server, to help with testing. But it seems kind of nice to use PHP5 and I've already installed Xampp, which has PHP5. When writing my PHP code, how likely am I to write something that will work on PHP5 but not work properly when I transport it over (I'm not talking about involved OO stuff, I know that has changed).

View Replies !
Upload Multiple Categorys To Choose From
if anyone know where i can find an upload script "mostly for image upload use" that has multiple categorys to choose from when uploading.

View Replies !
Send More Than One Email Per Option Choose
I'm trying to send more than one email per option choose. when software is chosen it will pass an array of different email addresses and send it to them.

e.g. when software is selected, then the email will be send to a number of addresses associated with that option. Code:

View Replies !
Php Globals To Handle Language Choose
i'm creating a cms, i want to handle the language choose, and i thought to handle it by setting a variable in the index.php. a variable that every other script and page can read. Now, i think it can be done using globals, but how? If i define "global $var;" in index.php, the other scripts do not see that variable. so how can i do?

View Replies !
How To Choose The Correct Height/width For Images
I have users that submit images to my website. By default I choose to
make the width bigger than the height because usually pictures are
taken horizontally... But in some cases people take pictures
vertically so what I'm getting at is... can I know whether an image
was taken horizontally or vertically so I can make the proper width/
height lengths so that it looks nice and not kinda weird... because if
you make the width bigger than the height of an image that is supposed
to have a bigger height than width, it looks kinda ugly.. And also is
there a way to know when I've enlarged the image too much? because if
an image submitted was small and I make it bigger, then it also
becomes kind of ugly to look at because I guess there aren't enough
pixels...

View Replies !
Form - Customer Will Be Able To Choose The Color Of The Product
I am modifying this form and I got this little problem. I have the following code and works fine but I need to implement a radio button between the following lines of code.

I hope sombody has a small clue on how to make this work. Depending of customer interest the customer will be able to choose the color of the product. After all requirements are selected the form will submit al the values in a print type of document. I have the following idea but I don't know how to implement it in this form.

View Replies !
Setup Allowing Visitors To Choose Their Country
I need to be able to change the currency and some form fields displayed on my website depending on where the visitor is based. I don't need a fully functional cart, just a kinda either display '$10' sort of thing. I was planning on having a map on my opening screen with hotspots over the countries. On the links for the hot spots I was planning to have something like href="functions.php?FuncToExec=countrySelectUS"> in the functions.php i was going to set a session variable to the country ie 'US' and then automatically move to my normal page.

View Replies !
Using Input Radio To Choose Applet To Load
i want to make an input radio button choose between 2 different applets i was thinking of making each radio button simply comment out its opposite <applet> code would that work? so far i have:

Applet 1 <input type="radio" checked name="c1" value="">
Applet2 <input type="radio" name="c1" value="">

<applet>applet 1 code goes here</applet>
<applet>applet 2 code goes here</applet>my thoughts were to simply add $FORM{'c1'} to the beginning of the <applet> code, to comment it out
like:
$FORM{'c1'}<applet>applet 1 code goes here</applet>
$FORM{'c1'}<applet>applet 2 code goes here</applet>that way i could set the radio buttons to make a value of "#"

i dont even know if that would work! problem i see is it would comment out both.

View Replies !
Quickest Way To Choose A Random Number NOT Already Chosen
I have seen snippets of how to create a random number using php. But what would be the most efficient and quick-running method of creating a random number that was not already created (stored in a MYSQL database).

View Replies !
How Do I Choose A Font Size To Exactly Fit A String In A Given Rectangle?
I have a background image (the size of this image can change), and I need to put some text in this piece of image. Depending upon the background image, the font size needs to be adjusted.

View Replies !
Search Drop Down Menu To Choose Mysql Table
I have currently made a simple PHP search script which, when data is entered in a text box and it's submitted, it queries a table in a MYSQL database and returns information. This works. However, I want to have a combo box beside the text box with options to query different tables depending on which item in the combo is selected.

At the moment it searches a news articles table by content and title. But I want to adapt the script so that it searches another table which holds information on people for example.

It currently gets the item from the text box with the code:

View Replies !
Search On User Choose From Drop Down Menu One Category
I have SQL base with several categories. I need some php lines to search on example
user choose from drop down menu one category and he get lot of data from sql base of that category and in that category choose another sub category ang get less results. Is that possible to make?

View Replies !
Choose From A Dropdown Menu Of Encryption/decryption Cyphers
I've written a php page which allows users to type in a text string and a key, then choose from a dropdown menu of encryption/decryption cyphers, and a method (encrypt, decrypt). The whole thing works, except the mcrypt command doesn't work. here is my mcrypt command:

if ($method == 0) {
//Encrypt
$output = mcrypt_ecb ($algorithm, $key, $input, MCRYPT_ENCRYPT);
} else {
//Decrypt
$output = mcrypt_ecb ($algorithm, $key, $input, MCRYPT_DECRYPT);
}

Here's a list of what the variables may be:

$algorithm = MCRYPT_3DES
$key = "plain text"
$input = "more plain text"

View Replies !
MIME Types - Using A Form To Choose From Which Folder I Want To Display A Picture.
I am running a windows distribution of php,apache,mysql. The basic idea is to make thumbnails from some pictures on the hdd. I think I am somewhere near a solution but I have trouble with the content_types/mime. It seems I can't mix html and binary data.

I have the filenames of the pictures stored in a database I call billeder.

In this database I have 3 fields: indeks(autoincremented field), filsti(a varchar field that shows the relative filepath of the picture),mappe(a varchar field to indicate which folder the picture is located in). The function semap is recursive and insert all foldernames and filepaths into the table.

I am using a form to choose from which folder I want to display a picture.
Below I have included my code. Any help is appreciated if you know how I can display my pictures. Code:

View Replies !
List Contents Of A Folder, Make List Of Links
Does anyone know how I can write a script that:

- reads in all the files in a particular directory
- displays the file names in a html list and makes a link of them:
<ul>
<li><a href="filelocation1">filename 1</li>
<li><a href="filelocation2">filename 1</li>
<li><a href="filelocation3">filename 1</li>
</ul>

etc.?

So basically it creates a list of links with the contents in that directory,
so you can download them from there.

View Replies !
Get List Of Messages From One Table, Message List Indicator From
I have two tables. One has a list of messages left by users using fields named mbxno for the mailbox and msgno for the message number. I have another table that has mailbox settings for each user that contains a field named "messagelist" to indicate if they want to be included on the message list or not.

What I'm trying to create is a list of the most-recent messages with a lookup on the users table to indicate whether a message in the list should be included in the message list based on the user's mailbox settings.

SELECT messages.msgno, messages.mbxno, users.messagelist FROM messages, users WHERE (users.messagelist = &#391;') ORDER BY msgno DESC LIMIT 100

What I'm getting, though is a list that looks like this:

mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 1114 msgno: 0412141623 msglist: 1

I think what's happening is that I'm using the wrong type of join and more rows are being created than necessary.

If I add "DISTINCT" to the query, I get a list of the most-recent messages as I expect, but the "messsagelist" value is sometimes wrong (again, probably because the data is getting jumbled). For example, the messagelist value for the second row (2214) should be 0, not 1.

mbxno: 1114 msgno: 0412141623 msglist: 1
mbxno: 2214 msgno: 0412141622 msglist: 1
mbxno: 2189 msgno: 0412141408 msglist: 1
mbxno: 0000 msgno: 0412141213 msglist: 1
mbxno: 0003 msgno: 0412141213 msglist: 1
mbxno: 2265 msgno: 0412132029 msglist: 1
mbxno: 0000 msgno: 0412131950 msglist: 1

How should I be doing this? If nothing else, what kind of join will work with a long list compared to a value from a short list?

View Replies !
Produce A List Of Tables Currently Within My Database And List Them In A Drop Down Box.
I need to produce a list of tables currently within my database and list them in a drop down box.

View Replies !
Populating A List Box Or A Dropdown List Using Php And Odbc
I need to populate a list box and/or a dropdown list on a form. I have all
the bits and pieces together, all bar the code which takes the result of a
query and creates a list box.

View Replies !
Mailing List Manager, Send To List
I'm looking for a mailing list script (php) that has a function to let
users to reach out to all recipient on the list by simple send the
email to a specific maillist- address.

Mailman has this functionn but as a just got a webserver account I
can't use mailman nor install it.

View Replies !

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