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.





Create State-cty Dropdown Lists


I've gotten everything up and running except for this -- I'd like to
be able to have people have a dropdown list of cities in the US to use
(or wherever) and not have to input them manually into a text field.
When you do then there are issues of misspellings, etc.

Now I have a list of cities from each state that is a sample that
works in an html page. Problem is that it takes up 2 MB! Way too much
to load on a single page and I was wondering how this is accomplished
best -- do people use javascripts that can pull information from
another flat flie? Do people use PHP to connect to a mysql database
that might have a list of these fields and then reloads the page?

I'm really not sure of best options and would be grateful for anyone
to give me pointers or whether there are other examples and even
places to buy these databases (not likely but good to have if I decide
to do so.)




View Complete Forum Thread with Replies

Related Forum Messages:
Showing Lists By State
I need to pull out a large list of companies out of a database for display on the web. They are listed by state, and I can sort them by state, but I need to show the state name as a heading above each state's list.

View Replies !
Dropdown Lists
I've been doing a site for a while now that has several drop down lists in a form. On one form there is the same drop down list repeated 3 times from the same table in a database but with different values. What would be the best way to repeat the code without repeating all of the code. Basically looking at an more economical way to do things. Would you do a while statement and loop through them or maybe a single array and call it when you need it. Any opions?

View Replies !
Dropdown Lists From A Mysql Db
Id like to load a drop down list from a mysql database using php3 and create a link to that record. Does anyone have any ideas?

View Replies !
Dynamic Dropdown Lists
I am recoding a greeting card website.

I am using dropdowns as filters for items in a DB, so when the user picks "animals" from the "theme" dropdown, the returned cards all feature animals, and when the user picks "birthday" from the "message" option, the returned cards all feature birthday cards.

However, there are some combinations that don't return any results, for example "get well" "floral" cards. Code:

View Replies !
Classes And Dropdown Lists
The class below works fine. The problem I have is there's a dropdown list in the middle of the loop. The dropdown list gets its data from another table in the database. Which goes through the same class. So I have a loop within a loop.

What I'm trying to do is ....

View Replies !
Get Two Dropdown Lists Working On A Page
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.

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

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

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

View Replies !
Trying To Create Dropdown Menu From List
I am trying to create a dynamic dropdown select menu from a directory containing other directories and files. This is to select a certain page from the list so I can edit it. I only want the files in the menu. Here's what I have so far but it doesn't populate the dropdown. Code:

View Replies !
How To Create A Dynamic Dropdown List
how to create a Dynamic drop down list using Mysql.

View Replies !
Create A Dropdown Of Remaining Months
I am attempting to figure out how I can do the following:

Take a date from a MySQL database like: 2006-06-01 (June 1, 2006)
Then have a dropdown list of remaining months using for example todays date of 2005-08-23
This would product a dropdown like:

1 month
2 months
3 months
4 months
......
10 months

View Replies !
How Can I Create A Page With A Search Box Or Dropdown Menus
I have a database that contains houses, price, discription and photo etc. How can I create a page with a search box or dropdown menus that will look at the database and return what I have asked for in the search box or dropdown menus? I know this is a big ask, so a special thanks to anyone who can lead me in the right direction. The table consist of columns which are: house_id, address, ref, high_lights, more_info, pics_thumbURL, and pics_mainURL.

View Replies !
Dynamic Dropdown And Hardcode Dropdown In Select Form
I have plenty of examples of dynamic dropdown choices but none of hardcoded dropdown choices. The ultimate goal is to have a job with various tasks and to track the status of those tasks for a given job. I've used one of the tutorials here to begin the process. Below is the code I have to add work on a given task. Perhaps I actually need to "Update" a job as opposed to "add".

But the problem of the moment is I can't seem to hardcode one set of my options. This is the code I have: PHP Code:

View Replies !
Best Way To State
IF 3 different variables equal different variables that I specify THEN  i want all this other stuff to happen. all the variables are not null, i echoed them to check their validity, it is a problem in my if/else statement that causes problems, this is how I set it up.

if ($keywordfileid == $fileid && $keywordip == $userip && $matchedkeyword == $keyword)

View Replies !
Page State With Php?
I'm trying to create a site that pages through data retrieved from a database.

Let's say there are 12 items, and only 3 at a time can be displayed on a single
web page.

So the user needs to see some king of navigation control (a simple link would
suffice) that tells him there X items ahead and Y items behind. This way he can
page through all 12 items, 3 at a time, moving forward and backward.

Does this require some king of page/session state? How will my code know if
items 1 through 3 or 6 through 9 are currently displayed?

My guess is I'm not the first one who has needed to solve this kind of problem.

View Replies !
State User Is In
Does anyone know of a script which can tell me what state a user is based in? I know there's ones for countries, but I need one to show the state.

View Replies !
State And County
I'm looking for a script or code that will give me drop down menus with each state and it's appropriate counties that will then be captured into a database.

View Replies !
Search By Zipcode And State
I began in MySQL section (with your help I built a database) and now into the PHP stage of my project. Basically client wants a search capability on his site. He makes a product, sells to dealers, dealers sell directly to customers. He wants to be able to search dealer contact info by Zip and by State.

DevShed member Baddy was kind enough to offer the following script geared towards the State search. Following his lead, I developed the Zip portion- this is my first stab at PHP- and I basically mirrored whatever he did for State- I did for Zip! Code:

View Replies !
Saving Memory State
Is that possible to save memory state to a file? (i.e. the content of every variable)

View Replies !
City , State , From Zipcode
Just wondering if anyone has a good function , or knows of one to return to city / state from a zipcode entered.

View Replies !
Want A Drop Down Of Country And State
Am working with a form ....

I want to make drop down of country list ...
And on the selected country the state list...

Not for the US,But for all over the world...

View Replies !
Changing State And City
ok, i am starting this project but i really don't know where to start, this is for a real state company ok

the user should be able to select one state once the user change the state the cities will change to that state, how do i do? Is it an array or a functions i need to create, should i created in the database.

View Replies !
Alphabetize By State, Add Checkbox
I need to display a list of dealers on screen that are grouped by state and alphabetized. All states need to be shown. For Example,

Column1--> AK
Result 1--> alphabetized list of dealers in AK

Column2--> AL
Result 2--> alphabetized list of dealers in AL

In addition, each dealer needs to have a checkbox next to delaer name.

What query do I need to send to the database? How can I format the page results so that all states appear on screen in an easy to read format?

View Replies !
Ereg City, State Zip
I ereg to check and see if a string matches this format:

city, state zip
ie: Beverly Hills, CA 90210

View Replies !
Search City,State OR Zip Code
I would like to build a search box like the one found here at CitySearch.com .

Depending on what the user entered, the results would be sorted by (1) Zip Code, (2) City, or (3) State. If the user entered a Zip Code, I'd like to have all results be sorted by it since a Zip Code would represent the smallest geographical area. If no zip given sort by City and State. It would be easy enough to accomplish if the fields were seperated into different input fields, but I wanted to replicate the CitySearch box exactly because it doesn't take up much room on the page with only one input field.

View Replies !
Carry Logging State Across Pages
After login in on first page , how to carry logging state across pages. So, every login names will be displayed on the every pages. I use oracle as my back-end database.

View Replies !
Mainting State Inside A Function?
I have a question which no doubt will pose you people with nor problem whatsoever to help me with

I have written a function to display coherent error messages throughout my entire site

I pass it 2 vars, which contain only text
one is for the document's title, one for the error message in the body (ofcourse there is formatting etc, but thats all inside the function and CSS)

problem is, when the function gets called, it loses state, ie.: the generated page doesnt start the session properly, even though I do this inside the function

what can I do to prevent this? some elements of the site are only shown when a user is logged in, so the effects are rather dramatic ....

View Replies !
Multi-domain Session State
Does anybody have a solution on how to keep a PHP session alive across multiple domains ? A solution that does not involved writing the session ID in the URL because I can't do that.

View Replies !
SQL Error: , SQL State 00000 In SQLConnect
Client is running PHP 4.0.5. on Win2K Professonal SP2 outfitted with Apache 1.3.2. Trying to connect to an Access 2000 DB using a standard odbc_connect() call. The DB is fine, all looks good, but this error is returned:

Warning: SQL error: , SQL state 00000 in SQLConnect in c:program filesapache groupapachehtdocsstaffindex.php on line 10

Anyone seen this one before?

View Replies !
Setting Radio Button State
I am trying to set the state of a radio button. I do not see what I am
doing wrong. Sorry, I am new at this.. I need another set of eyes to
look at this snip of code. I am trying to set the radio button with this
link of code:

echo 'SCRIPT language=JavaScript
setCheckedValue("'.$_SESSION['abbr_letter'].'");</SCRIPT>' //?

<snip of code>

<?php
session_start();
if(!isset($_SESSION['abbr_letter'])) {
$_SESSION['abbr_letter'] = 'A'
}
require_once 'includes/config.inc.php'
require_once 'includes/header.inc.php'

if (xdebug_is_enabled())
echo "enable";
else
xdebug_enable();

//
// Start a Form
?>
<HTML>
<HEAD>
<link href="quotesCss.css" rel="stylesheet" type="text/css">
<SCRIPT TYPE="text/javascript">
<!--
// set the radio button with the given value as being checked
// do nothing if there are no radio buttons
// if the given value does not exist, all the radio buttons
// are reset to unchecked
function setCheckedValue(newValue) {
var len = document.author_abbrv.abbr_letter.length
for(var i = 0; i < len; i++)
{
document.author_abbrv.abbr_letter[i].checked = false;
if(document.author_abbrv.abbr_letter[i].value ==
newValue.toString())
{
document.author_abbrv.abbr_letter[i].checked = true;
}
}
}
-->

View Replies !
The State/province Fields As Required?
in the ecommerce, when customer register, we will make the city and state/province and we will use javascript/php script to check to see if the city or state fields are empty or not. Both city and state are required. But if the e-commerce site is for the whole world (even 98% may be for usa and canada), some small countries/islands will not have state field.

But we are making it a required field, for the customer from these places, unless they fill in something in the state field, they cannot register.If we remove the empty checking for the state, then we lose one error proof checking for other 99% customers.



View Replies !
Maintaining Session State Problems??
I have a signup.php file which contains a whole bunch of fields that users put details into when they are registering for my website. When the click the submit button, it goes to validate.php to validate all the fields are valid (i.e -> not empty etc etc).

So when the user clicks submit it goes to validate.php, I get all the variables from the first page by doing something like this. Code:

View Replies !
City-state Public Domain
I might get information that's in the public domain related to major cities/states in the U.S.? facts, statistics or other. Something I could place on my site, for all the states in the US. Preferable in a database format, if this isn't asking too much it would be great.

View Replies !
Country, State, City Database
I need to design an event database by country, state, city for clients. How is the best way to begin this project for speed of initial selection of location.

View Replies !
Dynamic State/City Dropdowns
I am wondering the best way to do the dropdown menus in a form where you would choose a province/state, then it would provide you with another dropdown of medium-large cities in that province/state?

View Replies !
Validating A Country / State Form Input
I'm having trouble validating a state and country input. I didn't write it so I'm confused about why my code isn't working with it. Code:

View Replies !
Login Script That Shows A Last Visited State
How can i do not using cookies but using PHP and MySQL to make a script that when a user after making a login it shows a last visited state, like: You last visited: 11 Hours Ago at 12:48 AM .

View Replies !
Possible To Calculate Localtime Based On Country/State?
Does anyone know of a script or package that will allow me to calculate
the localtime given a country code (and optional state/province for
US/Canada)?

It should factor in daylight saving time when applicable.
If there are special cases where country + state isn't enough that's ok,
a solution that's correct 95% of the time would be better than no
solution at all.

View Replies !
Grabbing Visitors OS, State, Isp, City Info
Everything else is fine, except OS, state, isp, city that I haven't managed to gather. Any ideas?

View Replies !
Detecting Error State Of A Page At Any Time
I am using register_shutdown_function() now to get a better handle on error on my site. Currently though I am not sure how to detect the last error or error state of a page; this would be nice so I could know whether the page has shut down normally or otherwise. Anyone know how to do this?

View Replies !
Compare The Value In The States Columns At Both The 'start' And 'end' State.
I have a database table that includes two columns, a 'state' and 'states' column. I'm trying to compare the value in the states columns at both the 'start' and 'end' state. And then compare the two variables to see if they are different. So I created two functions, and have these in my 'functions' file. I want to be able to pass both these variables to another file, and have them compared at a specific time.

View Replies !
Swap Image - Over State Not Retained - Because Of $_SERVER['PHP_SELF']
I have created a navigation menu with dreamweaver mx. On roll over the image is swapped and onpress the over-state is retained, so the user knows where he is. When using dummy links, like <a href="#"> it works. But in my case:

View Replies !
Populating City,state,country Drop Down Menu
In the registration form I have city, state, country fields. I was
wondering if there was a database available on the net which has the
list of states in each of the countries. That way when a user selects
a country I could automatically populate the state drop down menu ...

View Replies !
Using AJAX, How Can The Page Get State Infomation From Backgroud PHP Script?
I'm not familiar with web programming, but I have a problem here.

I have a page. When a user click one button on it, I will use AJAX to
request a PHP script which will do a bunch of tasks, asynchronously.
These tasks might take long time so I want to keep the user informed
of the progress. The problem is that only the PHP script knows the
progress, how can the web page gets these information from PHP script?

View Replies !
Setting Up MySql Country, State City Table
I'm working on an application where country city etc. is the key. I am able to set them up as individual table in MySql, however I'm sure there is a specific way this must be done to work properly. Here's whet I need to do.

Country (USA / Canada)
State / Province
Region in State or province
City

The customer will be ale to post to thier city but I want them to be able to see data by:

Country (which has many cities)
State (which has many cities)
Region (which has many cities)
City (and perhaps even a link to bring up cities close to them.

Can anyone steer me in the right direction with an idea of how the framework should look?

View Replies !
Warning: Unexpected Character In Input: '' (ASCII=92) State=1 In /home
I am recieving the following error on one of my scripts...
Warning: Unexpected character in input: '' (ASCII=92) state=1 in /home/penguinp/www/www/aphistory/admin/addbooster.php on line 16

Parse error: parse error in /home/penguinp/www/www/aphistory/admin/addbooster.php on line 16

here are lines 15-17...

for ($i = 1; $i <= $noq; $i++) {
fputs($pob,"<? $q$i = "" . ${"q".$i} . "";?>");
}

View Replies !
Mysql Select Question, Counting Total Recs For Each State?
I have a bunch of event records for various event dates.

I want to write an select state that shows the following

State Count
AZ 50
AR 2
AK 450
CO 75
CT 92

etc.

sorted by state of course.

View Replies !
Change From Win To Linux Server Caused Error SQL State 01S02
I'm using windows server before and there was no problem with the program. The problem happened when i adopt it into Linux servers. I'm using PHP 4.3.0, Ms-Access Database, and ODBC Driver Here's the error message :

Warning: odbc_exec(): SQL error: [unixODBC][Driver Manager]Option value changed, SQL state 01S02 in SQLExecDirect in /home/php/ranking/index.php on line 422 Code:

View Replies !
Warning: SQL Error: [Caché ODBC][State : 08S01][Native Code 461]
I'm trying to connect PHP on Caché Database and I'm having a problem. This is the error:

Warning: SQL error: [Caché ODBC][State : 08S01][Native Code 461] [c:phpphp.exe] UNKNOWN MSG, SQL state 08S01 in SQLConnect in c:program filesapache groupapachehtdocscache_test.php on line 27

PHP knowed the ODBC Driver for InterSystem's Caché, but it stops in this problem. How can I resolve this?

View Replies !
No SQL State Code Error When PHP Connects To MS Access MDB File On Hosting Provider
I have made a web application with PHP that retrieves data from a Microsoft Access MDB file stored on a Linux hosting provider.

The problem is that I get this error message when I try to connect to the MDB database:

Warning: odbc_connect(): SQL error: , SQL state in SQLConnect in ... at line ...

As you can see there is not a SQL state code. Sometimes the code appears as a sequence of unreadable special characters.....

View Replies !
Mailing Lists
I have searched in many places about how to set up a mailing list that is scalable yet no web sites seems to want to give out this info. I need to have this mailing list be effective even up to hundreds of thousands of users. Any advice/resources on how to set up this mailing list?

View Replies !
Email Lists
How would I go about making email lists? Someone who has something similar to what I want told me that they handle it with PHP. I'm not talking about a form where I can email an entire list, but rather an email GROUP, such that any time email went to URL from ANYONE that is a member of my site, it would come into domainname.com, and then sent back out to everyone in the "group".

Any info would be helpful. Is this possible with php? What is the email process? Right now I'm not even on a domain name on my own server.

View Replies !
Ordering Lists
I have developed a script (with help) that tries to order events stored in my .txt file by date. The .txt file looks like this: 1st|Jan|Meeting at House| 15th|Feb|Meeting at your House etc

The script orders the dates from lowest to highest but does not order dates before the 10th. Apparently 1st - 9th comes after 31st.. Code:

View Replies !

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