Select List
I'm creating a form that has three select lists. The first one has two values EMAIL and SMS. What I want to do is have the two other select lists (named EMAIL and SMS) work so that if EMAIL is selected only e-mail select list can be altered and vice versa with the SMS.
How can I do this? I know to use disabled in <select> -tag, but how can I check the what the value is (and the value changes) and then act acording to it?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Select List With A Loop
I want to accomplish a function that creates a select list with a loop of results from the DB, I have that, it is: PHP Code:
List Box Multiple Select
I am trying to create a drop down list that permits a person to select multiple items from the list and have the results posted on a results page. I am using Dreamerweaver MX, PHP and a MYSQL database. I was able to select multiple items but only the last selected item would be displayed. I tried to modify the list box code and now it returns nothing. Code:
Select List/Menu Using PHP And MYSQL
Here is my code: <select name="country" class="sidelinks"> <?php do { ?> <option value="<?php echo $row_AllCountries['country_ID']." ";?>"<?php if ($row_AllCountries['country_ID'] = $acountry) { echo "selected"; }?> > <?php echo $row_AllCountries['countryname'];?></option> <?php } while ($row_AllCountries = mysql_fetch_assoc($AllCountries)); ?> </select> A few words to describe: -$row_AllCountries['country_ID'](get from MySQL) is a unique country ID number -$row_AllCountries['countryname'](get from MySQL) is the name of the country -$acountry is the country ID number that i want to be selected when the form loads I have all the values and country names named OK...the only problem is that when the form loads it selects the last country.
Displaying A List Of Categories From A Database In A Select Box
Could someone please tell me why this outputs nothing <select name=categories> <? $cat_array = get_categories(); foreach($cat_array as $this_cat) { echo "<option value=""; echo $this_cat["category_id"]; echo """; echo ">"; echo $this_cat["category_name"]; echo " "; } ?> </select> ========================================================== function get_categories() { //get the list of categories from the database $conn = mysql_pconnect("localhost", "user", "pwd"); $query = "select * from categories"; $result = mysql_query($query); if(!$result) return false; $num_cats = mysql_num_rows($result); if($num_cats == 0) return false; $result = db_result_to_array($result); return $result; } //A function that returns a query to the database as an array function db_result_to_array($result) { $res_array = array(); for($count=0; $row=@mysql_fetch_array($result); $count++) $res_array[$count] = $row; return $res_array; }
Trying To Select Names From A Drop Down List And Display Them
So, I already have the code written where I have a drop down menu with names in it. I want to be able to select multiple names from the drop down list and have them display in a table below the drop down menu. First off, I can't get one name to display, not to mention multiples. :p How may I accomplish this? CODE:
How To Response Immediately When I Select The Drop-box List
Do you have any idea when I try to select a drop box list, the data will show up in the following textbox immediately? eg. Name: --------------- drop-box list | <- when i select one of them --------------- Age: --------------- Textfield 1 | <- pop up immediately --------------- Address: --------------- Textfield 2 | ---------------
Popup Window List Of Values To Select
What i need to do is bring up a popup window with a list of values(values looked up from the database). The user should be able to select one of the values from the list and the value then populate a text box on the calling form.
Retrieving Full Entry From Multiple Select List
I have a list box with multiple selects. I define the name as numList[]. I get the values from $picked = $_POST['numList']; It retrieves values for all those selected. If the entries are, say, First Second Third and the first and third are select then $picked[0] has "First" and $picked[1] has "Third". If, however, the entries are: First one Second one Third one Then the values are for $picked[0] and $picked[1] are "First" and "Third" respecticely. How do I retrieve the entire value and not just the first word?
Retrieving Contents Of Select List On Form Submit
On an HTML form, I have a select list that is fed dynamically with detail records when the master record is displayed on the form. There is also a second lookup list, and want to allow the user to dynamically select from this list and add to the first list. I also want the user to be able to dynamically remove from and reorder the first list. I think I can do all of this with JavaScript. The question I have, is how can I retrieve the contents of the first list when the user submits the form? I need to get it back into a php array so I can update and add the proper database records.
Select From Drop List To Fill Table Column With Text -- HOW ?
I want viewers to compare state laws on a single subject. Imagine a three-column table with a drop-down box on the top. A viewer selects a state from the list, and that state's text fills the column below. The viewer can select states from the drop down lists above the other two columns as well. If the viewer selects only one, only one column fills. If the viewer selects two states, two columns fill. Etc. I could, if appropriate, have a separate htm page with the text for each state -- california.htm for example. When the viewer selects California from the drop down list, the column below would "fill" with California.htm. Or, I could conceivably use a text or mysql database with two fields for each record: state_name and law_text -- but it would probably be easier to use separate htm files, since there will only be about 20 states involved, and the "database" would never have a large number of records. The table width would be 100% and each cell would be @33% My site is designed with FP 2002 and runs on Apache/FreeBSD. I have just had Apache-ASP installed but I have not yet configured or used the module.
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.
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 = Ƈ') 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?
Multiple Select From Listbox And Execute A Sql Query Select Statement
Supposing i have a html form with 2 listbox and i name it status and resolution. So it goes <select name='status[]'>... <select name='resolution[]'> Then i have a another php page. $status = $_POST['status']; $resolution = $_POST['resolution']; Now my question is, how do i do the sql query statement? mysql_query("SELECT * from bugs where status=$status and resolution=$resolution"); The problem is, i select 3 options form the status listbox eg. new, closed, duplicate. And from the resolution, i chose fixed, invalid.
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.
Select Statement - Select Random ID #
I have made up a page that pull info on 13 branches of stores onto one main page. It's basically there to display all the branches on one page... then you click on the one you're interested in and then you go to a more detailed page. Back to the main page. On the top, there's kind of a featured branch that has a bigger picture and bigger title but it's still getting pul pulled from the same table etc etc etc. In order for me to avoid favortism to one branch (and for other branches to start complaining) I want to ramdomized the order every time someone came to page but I have no idea how. right now I have a super simple select statement.
Using List
when my form is loaded i populate a list with a database query. now when user selects a value from the list. on "onChange" another query runs and other fields on the form are populated according to the value selected by the user but at this time when page is loaded again and the fields on the form are filld. every thing goes write but the select list doesn't have the same value selected that was selected by the user...the selected list shows the default valuse selected instead. i want to know that how can we do this that when we select a value from the list and page is populated using this vale and refreshed then again i want to see the selected value in the list box not the dafault value.
Mp3 List
I can't figure why I can't list only mp3 files with this code : <?php $dir = opendir("."); while($file = readdir($dir)) { $ext = getFileExtension($file); if ($ext = "mp3") { echo "<a href=" .$file.">".$file; echo "<p>"; } } closedir($dir); function getFileExtension($str) { $i = strrpos($str,"."); if (!$i) { return ""; } $l = strlen($str) - $i; $ext = substr($str,$i+1,$l); return $ext; } ?>
Buddy List
I have a community, now it´s time to upgrade and make a buddy list. Ive started wtih the file that ask´s the other member for a relation. The code looks like this PHP Code:
Problems With List()
I am having some problems with the list() function. Here is some code: <? $USERDB = fopen("users.db", "r"); while ($line = fgets ($USERDB, 4096)) { list ($name, $occupation, $favcolor) = split ("|", $line); print ("Name: $name<br>"); print ("Job: $occupation<br>"); print ("Favorite Color: $favcolor<br>"); } fclose ($USERDB); ?> And here is whats in the text file: Van Tate|Software Engineer|Green Now...when I execute the script I get this error: Warning: bad regular expression for split() in /var/www/html/v2/getusers.php on line 7.
List Constants
A little embarrassing but: is there any easy way to echo (the name and value of ) all defined constants?
Drop Down List
I want to read a directory for available files and then get the filenames and put them in a drop down list. Whatever the user will select will be the value of the variable $selected. I already found the code to read directories: Code:
Loop Through A List
I want to loop through a list and display it in a table with three columns per row, yet haven't had much luck in doing so. I was thinking if would be something like so Quote: for ($x = 0; $x < mysql_num_rows($query); $x++) { if ($x / 3) { ?> <tr> <? } ?><td> Blah </td></tr></table> Well, that's as much as I know so far.
Add Number In List
I am outputing a list of 10 values. 10, 20, 30, 40, etc I can add 15 to one of the values then reorder the values from smallest to highest but i want to update every single value and assign it values increamenting by 10 so after the update the second number of 20 and add 15 I get 10, 30, 35, 40 now i want to re output the values above as 10, 20, 30, 40
Php Mailing List
Can anyone point me to a php script that stores email addresses into a txt file? The purpose for this is for a mailing list, ideally if a user wanted to unsubscribe the email would be removed from the text file.
PHP Link List
On a page from Thredz (http://www.thredziii.com) I saw a script (it's not on anymore...cause he didn't want the script to be on his page) and I love it... It's a script that makes it possible that on a page links are sorted ALPHABETICALLY with the first letter of the "URL name"... (take a look on Thredz' site to c what I mean,K?) Then people got 2 have the abbility to fill in a small form, ON THE SAME PAGE WHERE THE LINKS ARE ON, where they fill in 2 fields; #1 = Name of the Site ($sitename) #2 = URL of the site ($url) When they fill out it form I want the PHP-script to put the information away as a link (in a *.txt-file...if possible) <A href="$url" target="_blank">"$sitename"</A><br> (something like this??? I'm not sure......) These links have to be sorted alphabetically (on the site's name,$sitename... I don't know how this works or how I have to make something like this... Could somebody please help me and give me a bit of help with it? Some explaining would be gr8 but the script written for me is the best wish I have.
Dropdown List
I have a Dropdown list with Select with 1, 2, 3, 4, after select on of them it bust to refresh the page to what you select but it don't do it. PHP Code:
Getting List Of Newsgroups Via Php
I am trying to write a PHP script that will download a list of all the newsgroups on a news server and put them into a MySQL database. I bought a $50 book that had some NNTP examples in it, but none of them show how to just download the groups, not the articles. I tried on my own for about 2 hours with no luck. If someone can point me in the right direction to download the group list using PHP, I think I can figure out how to write it to a database.
FTP List Problem
I used ftp_rawlist, not ftp_list. [color=blue] > I used ftp_list and ftp_nlist. Both of them worked when the target is Sun > or Linux machine. However, it didn't work when the destination is VXWorks > (embedded platform). The version of php I am using is 4.3.2. According[/color] to[color=blue] > my search on google that problems for ftp_list and ftp_nlist for some > platforms were fixed in 4.3. > > If I manually ftp to the VXWorks, I could use the "dir" or "ls" to see the > listing at the destination. >[/color]
List Certain Files In A Dir
I am working on a news script were my members can post what they are currently working on. I have a dir were all of there images are going to be uploaded, and I need to know if the following is possable to do. $username = the members name selected from the database $projname = the projects name selected from the database What I want to do is select only images with the filename containing the info. The filenames are like this: TheBlackshinobi_3dmountain_1.jpg TheBlackshinobi_3dmountain_2.jpg TheBlackshinobi_3dmountain_3.jpg
Php And Drop Down List
I am coding an email form on a site. A user enters their name and contact email and then selects from a drop down list to which particular email the message should be sent: User1, User2, User3. Then the user types out a message and hits submit. My problem is that I am unsure as to how to grab the selection in the drop down list and pull the selection and place it like this: "$selection@domain.com". Here is the php code:
PHP Shortand List
Is there a place where I can find a list of all the shorthand/shortcuts in PHP's syntax. IE: $_POST, $counter++, etc? Anyone know?
Getting A List Of Newsgroups With PHP
Does anybody know of a quick and dirty way that I can connect to a news server, retrieve a list of all newsgroups beginning with alt. (or comp., or blah., or wibble., doesn't really matter), and also the newsgroup descriptions, and then dump them all in an html file?
Php Mailing List
Is it possible to implement a mailing list using PHP?. I know I could maintain a list of emails addresses in a db and send mail to them through my website, but how can I get true mailing list behaviour where emails are sent to a particular address (like mailinglist@mydomain.com) and then distributed to all of the email addresses?.
While(list => Checkboxes
I wanted to print out checkboxes for those which are checked when form is being submitted. Whilst, this is my function: PHP Code:
Best Way To List Pages A - Z
I now have my emulator site up and running, no longer html but php! Even my vote script now works, thank for all your input. Now I want to have roms on my site for download, but it's a fair long list so you have to devide in sections a - z or something. Can this be done in a way to create those pages with php/mysql instead of have to write html files for every emulator roms page from a to z? If anyone have done this before I would like to here what the possibilties are.
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>
Css List Navigation
I found a nice link about CSS liquid layout. Specially for css list navigation ....
How To List A Directory
I would like to get a list of a local directory content using php. I would be very appreciative if anybody could tell me how to do that. I loocked in the php manual but coulsn't find anything (probably I just missed it).
Problems With List..
I have a function returning smth like list($a,$b): var_dump says: list(string $a, string $b) blabla() How can use this strings now? I try: list($a, $b) = blabla(); print($a); but it's won't work returning empty string. I tried also: $result = blabla(); print $result[0]; but it also won't work. The only thing I can do is to iterate result with foreach, then it works nicely, but how should I use the result of blabla() function without foreach? I just want to get to $a and $b.
Selection From A List Box.
php and have to implement this functionality to select a user from a list box. I have written the code for this, but the problem is after selecting a name and doing the required task, it again selects the first entry in the list box. So if there are 100 users, the 100th one has to scroll down again and again. I need to modify this code so that until the session expires, if a person has selected his name once, that name will be selected in the listbox until he changes it. <select name="name" style="width: 120px;"> <?php $query = sprintf("select * from person order by person_name"); $result = mysql_query($query); $i = 0; while($row = mysql_fetch_array($result)) { $i++; printf("<option value="$row[person_num]">$row[person_name]</option>"); } ?> </select>
To-do List To Add To Site?
I'd like to add a basic to-do module to my web site. Could someone recommand something, either MySQL- or flat-file-based?
List And Explode
I have been searching for a reason for this behavior but no solution so I figured I would ask. Basically I have a web page that displays data in a database to the user for updates/deletion/addition. For each data field ont he web page I put the data from the database in the field name with teh field name and data seperated by a |. ex: address|35 Elm St. I then loop thru all the fields on the form and if the data in the field name doesnt match the data submitted then update the database. Here is the code: foreach ($_REQUEST as $curFld => $Data) { if ($curFld <> 'Submit') { list ($field, $orig_data, $table, $id) = explode('|', $curFld); if ($orig_data <> $_POST[$curFld]) { //UPDATE DATABASE $sql = "UPDATE $table SET $field = '".$_POST[$curFld]."' WHERE ID = $id"; $result = mysql_query($sql, $_SESSION['conn']) or die(mysql_error()); } } } Here is the problem, either list() or explode() is replacing all spaces in $orig_data with underscores so 35 Elm St. becomes 35_Elm_St.. This causes the code to always update this field and any others where this occurs. Obviously I could do this str_replace("_", " ", $orig)data) to fix this problem but if the user wants to use underscores I dont want to replace them. (Address is not the only field on the page.
Dropdown List
i am trying to get two dropdown lists working on a page. How do i go about this. For example, I have 1 table which holds countries and cities. When a user selects a country in the first dropdown list, i'd like the second dropdownlist populate with a list of cities etc. from my database.
List Db Contents
can someone help me make a script that will list the information in one colum in my table! See each clan I have has an ID, and CEO and bla bla bla! But what I want done is it to only show the name of the clan in A dropdown menu. So that when users are signing up they can select the clan they want and it well ya you know puts the name beside theres in the table. But can someone make me a script to list all the clans Names and only names not ID, Ceos, and all that other stuff. Code:
Drop Down Box To A List Box
i have this drop down box that displays the relevant info from the table that its loading. But the drop down box isn't quite so wise to use if there hundreds of rows. So what i wanted to do was change it to a list box instead ... would any one know how to do that? Code:
|