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.





2 Questions. Dropdown Menu And # Of Rows.


1. I have a table named pics and a column named name, just to let you know for use. I want to take the data from each row in the name column and insert it into a dropdown menu.

I know how I could do it, but I would have to go:

Code:
<SELECT NAME="name" SIZE="1">
<OPTION SELECTED><?php $name[10 ?>
<OPTION><?php $name[1] ?>
<OPTION><?php $name[2] ?>
<OPTION><?php $name[3] ?>
<OPTION><?php $name[4] ?>
<OPTION><?php $name[5] ?>
<OPTION><?php $name[6] ?>
</SELECT>
but then I could make too many or too less. I want it to automatically adjust to the number of rows.

2.What is the code needed to find out how many rows are in a table?




View Complete Forum Thread with Replies

Related Forum Messages:
[PEAR:QuickForm] Dynamically Change A Dropdown Menu According To Another Menu?
I've been using QuickForm for a few months now and I am now given a
new challenge:

I've got a search form with a dozen of dropdown menus, the first
dropdown menu being "Brand". If you select either Brand A, B, C, D...
Z, the second dropdown menu "Model" must be dynamically changed to
model AA, AB, AC, AD..., according to the models manufactured by the
brand selected in the first box.

I've seen that done on quite a few sites, but never found if QuickForm
had a quick & clean way of doing that.

View Replies !
Dropdown Menu
i seem to be having some problems on finding how this ajax drop down menu i seen at Anime-Eden.com.

it has a nice effect on how it appears. Now i am familar on how PLAIN drop down menu works, but not how this works.

View Replies !
Use A Dropdown Menu
I have a list of contacts which are sorted by name. I was hoping to create a dropdown menu in which someone can sort the list of contacts by office, city, state, and contact type. Is this possible? (I am sure it is, but I am not sure what the concept is called so I may research how to do it).

View Replies !
Advanced Dropdown Menu
I want to populate a dropdown menu with countries that are in one column of my table. I know how to do that, but I can't find how to eliminate multiple items. Some countries appear several times in different rows, but I only want each available country to be shown once in my dropdown list.

View Replies !
Mysql / Dropdown Menu
what i am trying to do is to make a system with a few input pages and edit and read pages..

so right now i got the input/edit/read pages working. (yay) But now I want to have on 1 input page a dropdown menu that reads its information from the database. and that if i go to the page i can select a value out of the db and submit that inside my form and that it reminds the value if i view or edit the page.

So what i got now is a little system that is able to add/remove/edit a value inside a field called "drop01"

Well now i got a other input page called "input01.php" inside this script i want to have the dropdown menu that reads its values from the "drop01" field. PHP Code:

View Replies !
Autoselecting A Value In A Dropdown Menu
I'm revamping my sites administration panel and I put in a dropdown menu to select the section to administrate (it was a LOT better than the list of links I had before, I'll probably update it some more though) and I want to know how I can autoselect whatever page I'm on in the dropdown menu, for example, here's the menu: Code:

View Replies !
Multiple Dropdown Menu
i attemp to design a drop down menu that call up data from a table for each drop down menu. Code:

View Replies !
Dynamic Dropdown Menu
with help from the PHP Gurus here, I have a dynamic menu script:

PHP Code:

<?php
$time = time() + 28800;
$time_plus2 = strtotime('+ 6 days');

echo '<select name="select">'
while ($time <= $time_plus2)
{
    echo '<option value=>' . date('l, F d', $time) . '</option>'
    $time = strtotime(date('Y-m-d', $time) . ' + 1 day');
}
echo '</select>'
?>

how do I now get the days of the week to link to different pages?

View Replies !
Assigning A Dropdown Menu
how i can assign a drop down menu value to a session variable.

View Replies !
Values From DB Into A Dropdown Menu?
Here's my database which shows which type of cards have been issued to a football player in my database: Code:

View Replies !
Populating Dropdown Menu From Db
Okay, I am trying to populate a drop down menu with items from a table in my db. I have a table called "teacher" which has the following info: I use the following code to grab the info from the teacher table. Code:

View Replies !
Dropdown Menu Updates
I have seen this on lot of sites, where say you goto a car site, and you click the make of the car from a drop down menu, and than after u click it, it will load up the appropriate models for that make.

View Replies !
Dropdown Menu Without Submit Button
How do I get a dropdown menu to submit with the selection of an option rather than pushing the submit button.?

View Replies !
Searching Database With Two Dropdown Menu
I have searched the whole forum for the script. Please let me know if there is any script .

View Replies !
Unwanted URLs In URL Dropdown Menu
I'm working on a PHP script and it has a user login, and the variables (username, password, id number) are passed via the URL bar. Is it possible to somehow not allow the visited page show up in the dropdown list of URLs in the browser? The problem is that people can view the list and easily see people's usernames and passwords. Example:

http://www.somesite.com?username=john&password=12345 What I only want is:
http://www.somesite.com/

I know that Hotmail.com doesn't show all of the pages that have been visited, all it shows in the list is hotmail.com, so I think it is possible to do this, but I don't know how.

View Replies !
Make A Dropdown-menu Filter?
I have a dropdown menu which is supposed to filter a table to show results for professionals, students or all. But I don't really know what I'm doing.  This is what I have so far. Code:

Initially, I was able to filter for students or professionals, but since trying to have an all option (students and professionals) it has gone to pot, and I keep getting errors.  I know that my quotation marks are not right, but I can't think of a solution. I would be more than happy to see any ideas, even if they are completely different to mine!

View Replies !
Query From Db, Add Values In Dropdown Menu
i wanted to query my db, and then add values to drop down menu, where when they select what they want in the dropdown, it will bring them to another page accounts.php where they will have more options.

View Replies !
Dropdown Menu <selected Name="...
I have a dropdown menu like this one:

<select name="country" tabindex="6" id="select_country">
<option value="">- Country List -</option>
<?php 
$query = "SELECT * FROM country ORDER BY country ASC";
$result = mysql_query($query) or die('Error, query failed');
while ($row = mysql_fetch_array ($result)) {
$country = $row['country']; ?>
<option value="<?php echo $country ?>"><?php echo $country ?></option>

After I have selected one country and I hit the submit button it go back to the default value in the box, what I want is to show the selected value in box until I selected another value.

If the default value is Australia when I start this page, I then select USA and hit the submit button it reset to the default value "Australia", but I want it to show USA as long I not select anything else. I have tried to use session in selected="<?php echo $_SESSION['country']; ?>" but it didnt work.

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 !
Selecting Item In Dropdown Menu
Im having problems trying to select a specific option in the drop down menu which has been populated with a list pulled from the 'category' table in the db. The option that needs to be selected is pulled from an id in a 'item' table, relating to the aformentioned category table.

View Replies !
Dynamic Dropdown Menu Glitch
I wrote this code to dynamically generate an array from files on my server and put it into a drop down menu, but the code cannot be inserted on any page anywhere without it cancelling the loading of the rest of the page. Any ideas? Here is the code: PHP Code:

<? $the_array = Array();
$handle = opendir('walrus/strips/.');
while (false !== ($file = readdir($handle))) {
   if ($file != "." && $file != "..") {
$file = substr($file, 0, -4);
$the_array[] = $file;
   }
}
closedir($handle);
asort ($the_array);
reset ($the_array);.....


View Replies !
Network Bar, Dynamic, Dropdown Menu
Basically I have a "network bar" that I place on the top of all my sites, which has a dropdown menu box to interlink all my other sites. Basically I would like to really modify this idea out more. Code:

View Replies !
Tree View Dropdown Menu
I have such a categories MySQL table: ID | name | parent and have such a function that displays the categories in a SELECT element as a drop-down menu:

function DD_ProjectCategories($parent=0) {
include("db.php");
$query = "SELECT ID,name FROM categories";
$result = mysql_query($query) or die(mysql_error());
echo '<select name="parentcategory">'
echo '<option value="">Choose a parent category</option>'
echo '<option value="0">Root Category</option>'
while ($row = mysql_fetch_array($result)) {
echo "<option value="$row[0]""; if ($parent == $row[0]) {echo " selected"; } echo ">$row[1]</option>";
}
echo "</select>";
unset($query,$result,$row);
}.....

View Replies !
Change List View To Dropdown Menu
Im working on a script that has to be change so a user can choose from a dropdown menu instead of a list that now is displayed.
Here is the part that is insert on the index page.

View Replies !
How To Pass The Value Of Selected Dropdown Menu To Another File?
there is a php-myql script that list the mysql databases in the drop-down menu, use wil select one and the submit button should pass the value or variable $db_name to the test.php, this script list the databases in the drop-down menu but when i select one and then click on submit cannot pass the db_name to the test.php:

View Replies !
Stuck On Dropdown Menu List, Could Use Some Guidence
I have a form with some drop down list/menus. I do a check for ommissions and if found display a message to re-try. What I need is a way to show which options where chosen when the user submitted the form the first time.

If someone could show me how to do the first one, I'm sure it's the same process for the second one. Here's the code:

View Replies !
Duplicates In A Dropdown Menu Populated From My Database
I've been searching to figure out how not to have duplicates in a dropdown menu populated from my database. This is what I have, but how do I change it to get rid of duplicates.

<?php
$result = mysql_query("SELECT City FROM residential order by City");
echo "<select MULTIPLE NAME="City_code">";
while($row = mysql_fetch_array($result)){

echo "<option name="City" value="$row[City]">$row[City]</option>";

}
?>
</select>

View Replies !
Pagination And Dropdown Menu Used In Searching Mysql
I am working on building a database made for searching. I have a text search and a dropdown box used for searching different table collumns (lets people search for certan criteria). I have that working correctly.

I also only want to show 25 results per page. I have that working correctly. My problem is that when I combine the two it breaks the code. The pagination works fine without the dropdown and vice versa. I think it is due to the variable that is being used to choose the collumn in the sql query. Code:

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 !
Got The Dropdown Menu Populated From MySQL, But Not The Results After Submit
I have a dropdown menu populated from the MySQL database in a form. When I hit submit I want the results of the selection to be displayed. Code:

View Replies !
Populating "Month" Dropdown Menu
I can get the current month to display in a text box by inserting
value="<? print strftime("%B"); ?>"> into the code for that
particular text box on a form but how can I populate a drop down with
names of all the months with the current one being 'default' as it
would be in the text box example?

View Replies !
Chain Menu But The Menu Should Be Multiple Select Menu/list
I am looking for codes to be able to do the same thing with multiple select menu/list.

PHP codes or javascripts codes are both fine.

1) javascript + php approach: Prefer to be javascripts codes to display the chain menu. I can use the php to get the all three levels menu data from the database, and assign these values to the javascript.

2) php codes only: Or use the pure php codes (the problem is if just using php codes then I have to submit the form to the server every time, when top level menu select changes to create new menu.).

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 !
Collapsing Menu - Code A Menu For A Webpage
I am trying to code a menu for a webpage, the menu is broken up to groups i.e:

Home
Group1
Â*menuitem1
Â*menuitem2
Â*menuitem3
Group2
Â*Â*menuitem1
Â*Â*menuitem2
Â*menuitem3
And so on.

What I want to achieve is that the groups are shown in a collapsed state depending on the page which is currently being displayed i.e so it starts out like this Code:

View Replies !
Child Menu Name Changes When Parent Menu Changes
THIS IS FOR A SEARCH RECORDS IN A DATABASE TO MATCH SELECTED CRITERIA OF A DYNAMIC OPTIONS LIST

I have a set-up whereby the <select name=" "> of the List determines which field of the datbase is searched. I've create a dynamic drop down menu whereby the Parent menu changes the values of the child menu - that works fine. Code:

View Replies !
Count Amount Of Rows In Same Query Of Selecting Rows
I am selecting some rows from a table and i wonder if i can count
the amount of rows in that same table in the same query? I tried something like: PHP Code:

View Replies !
Fastest Way To Get Number Or Rows Of 500 000 Rows?
I am displaying the results 50/page of 500 000

So to get number of rows using select count(*) then do another select to get 50 rows out of 500 000 gets somehow slow..

When i tried to put the total count as fixed number and not executing that first select... it went so fast..

So i want to get number of rows by any other fast way! The number of rows can change anytime the user submit a form which can happen few times/hour..

Is it a good idea to make like crons job every 30min to calc the number of rows and keep it in another table, so that i just select it when i need it instead of doing full table scan everytime?

View Replies !
Several CMS Questions
I am fairly new with PHP but I have used several news posting scripts in the past and none have been simple enough for me. I'm working on creating a site with the following layout, and I need help on a few issues along the way (those questions will be in bold so please check them out, even if you don't want to read everything else!).

The basic site layout will use a few "template pages." I.E. main.php and print.php and textonly.php. What they are is fairly self explanatory. The further pages will be accessed in the following manner: http://mysite.net/main.php?content=FAQ Would import a file called faq.php/html/txt (which is the best form for my content?).

I also want a news page. Should it be imported in the same way as the other pages (I.E. main.php?content=news)?
On every page, I want a "headlines" section with the last 5 recent "headlines" (from the news) and a link to them. On the news page, I want the last 5 news items listed. For my news system I could use MySql or just Flat files (I.E. a file called news.txt which has a uniqueID|author|title|date the uniqueID is the name of a .txt file with the content of that news item). All news items (not just the most recent 5) are found on an archives page, listed by headlines/date/author. Which is better (MySql or Flat files, considering how simple this news system will be Flat may be simpler) and how can I set it up in the way I asked?

Also, I created a simple system of PHP to go to different pages depending on the ?content= variable. I want it to go to a specific page if ?content= anything not listed in my variables. Here is what I have, it works except it won't go to google.com if anything "else" is written. How can I fix the code below to work?": PHP Code:

View Replies !
Else If - Questions
I have put togther a script which uploads images and renames them with the article ID, so that image names are always related to the article that is added.

But....when calling the individual article to view in a html page I want it so that if there is an image it shows it other wise don't show anything or show a blank pixel image. This is what I have tried and it does show if an image is there, but if the is now image present it shows an image box with missing link. Code:

View Replies !
A Few Questions
Say I wanted to send an HTTP request to a web server on port 80 - would
fsockopen or socket_create be better to use?

Also, I'm unsure of whether or not stream_set_blocking would be a
useful function to use for HTTP queries... any ideas?

Finally, the output of this seems a bit surprising:

<?
ob_start('test');

function test()
{
return getcwd();
}
?>

It displays / while the following displays something like
/path/to/file/

<?
echo getcwd();
?>

View Replies !
Pdf Questions
I have a pdf govt issue tax form for non-profits and am trying to
write a script that will handle browser based entry of data fields as
well as save some info to database

It is a tax form and has to be parsed to the pdf file that the govt
provides for printing...

Am completely stymied on how to pull all the field data, and to post
it to the pdf the pdf in question is



View Replies !
Questions About PHP-GTK 1.0
PHP-GTK is the ticket one can take to create cross-platform
PHP scripts that load a standalone GUI application with widgets, and
then everything else you know about PHP can work in the background via
signals (widget events), including database access, etc.

Some background for you:
http://www.sitepoint.com/article/697

Personally, I can't get it working. Others have, strangely enough.

1. I have RH9. Does anyone have an RH9 RPM out there for PHP-GTK 1?

2. Would it be good for me to install Glade to draw the GUIs and
connect the signal handlers faster? I don't have experience with
Glade.

3. I tried downloading the 1.0 source and then doing:

../buildconf
../configure
make
make install

but it bombs on ./configure with...

../configure: line 2606: syntax error near unexpected token `debug,'
../configure: line 2606: `PHP_GTK_ARG_ENABLE(debug, whether to include
debugging
symbols,'

4. I tried the steps recommended in the sitepoint.com web link I
posted (above) and it showed the same error, so I commented out the
code block starting with if on line 2606 to its following fi. Then, I
ran the commands as recommended from the web link, it runs good for
awhile and then spits back to me this error:

/home/me/installs/php-gtk/build/dynlib.mk:22:
/home/me/installs/php-gtk//libs.mk: No such file or directory
make: *** No rule to make target `/home/me/installs/php-gtk//libs.mk'.
Stop.

What's the catch?

View Replies !
Md5 Questions.
Ok, I have a simple registration form, which md5's the password.

Now I'm trying to make it so user can login, however, the passwords obvisiously don't match, as the password is encrypted. I tried putting md5( ) around the $password variables in my script, but as I've just learned what md5 is just now, I'm not sure that I'm doing it right. Code:

View Replies !
PEAR Questions
Can someone explain to me exactly what PEAR is?

I've been looking around for different html modules/classes and it keeps coming up, but I can't find anything that actually explains what it's all about.

Also, is there a complete list of "PEAR" modules anywhere, organised in one place?

View Replies !
Cron Questions
Just a few questions about cron files:

Can I include other files? Eg

<?php
require(config.php);
....

That's pretty much it! I'm running a cron job from DirectAdmin and I keep getting an error email with:

/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 1:?php: No such file or directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 2: //: is a directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 3: //: is a directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 4: //: is a directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 38: //: is a directory
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 39: syntax error near unexpected token `('
/home/aliashos/domains/aliashosting.co.uk/private_html/inc/cron/subscriptioncheck.cron.php: line 39: `$udq = mysql_query("SELECT * FROM $CustomersTable",$Link) or die(mysql_error());'

And if I run the file in my web browser, it works fine! Confused :S

View Replies !
Login Questions
I have 2 books 1.) MySQL/PHP Database Applications and 2.) PHP4 Bible. My problem is that in both books the only way they show how to use a login form is to use the HTTP_AUTH. Which I don't want to use, I want my script to do the login and log out Like VB does. Where or how would I go about doing this? I can enter data into MySQL, but I know i am missing some steps, such as Md5ing the Password and sessions and such. Any info would be great.

View Replies !
IMAP Questions
I've spent hours, days .... weeks(!) reading the manual, but still can't find answers to my questions regarding the use of some IMAP functions and their miscellaneous properties.

From now, I'm gonna list all those questions on this thread and see if some of you can provide even partial but useful comments.

Question number ONE : imap_setflag_full

In imap_setflag_full($mbox, "2,5", "Seen Flagged"); we have the string sequence "2,5" but I fail to understand if it is safe or not to choose any sequence I want regardless of the message structure.

For example, if I apply a "Flagged" flag on all incoming messages exclusively at "2,5", is it possible that I could overwrite some precious information in that particular place? What are the implications of such a method?

View Replies !
Questions About Config.php
We all know its effective to create one central config file say "config.php"
that contains the required configuration variables.

I had seen the configuration is done by three ways:

1> By simply using variables ex $dbHost = ""; etc
2> By using associative arrays ex $setting['dbHost'] = ""; etc
3> By defining constants ex define("DB_HOST",""); etc

My Question?
Which one to use and why in config.php for creating the configuration file?

View Replies !
A Questions About Mysql_fetch_array()
whenever i use this, i'm leaving out one item from the array. in other
words, one row from the table i'm querying won't show up. i'm new at
php, and this is probably a simple thing, but please help of you can.
here's an example that leaves out the most recent submission:

$query = "SELECT topic, message, author, DATE_FORMAT(posted, '%M %e,
%Y') AS d FROM messageboard ORDER BY posted DESC";

$result = @mysql_query ($query);
$row = mysql_fetch_array($result, MYSQL_ASSOC);
while ($row = mysql_fetch_array ($result, MYSQL_ASSOC) ) {
echo"<p> {$row['topic']}<br>
{$row['message']}
<br>Posted by {$row['author']} on {$row['d']}
<br>";
}

View Replies !
Pcntl_fork Questions
php.net's docs on pcntl_fork aren't exactly clear on how to spawn
multiple child processes...

i tried something like this, but it didn't seem to work:

<?
$pid1 = pcntl_fork();
$pid2 = pcntl_fork();
$pid3 = pcntl_fork();
if ($pid1)
print "test;
if ($pid2)
print "test2";
if ($pid3)
print "test3";
?>

any ideas why it didn't work?

View Replies !
PHP GTK Option Questions
Before I invest more time in researching and testing I am curious if anyone knows for certain if a PHP_GTK application running on a Windows machine can communicate and interface with a remote database SECURELY?

My plan involves creating a support system which would be a standalone application on a Windows Workstation. This application would query data from a remote database SECURLY and then support personal would be able to modify, edit, etc. data from the PHP_GTK application which would in turn update data in the remote database, again securely.

Can a PHP_GTK application support this, security being the biggest concern?

View Replies !
Questions About Sessions
First, just wanted to say that I found what I thought was a very helpful
tutorial on sessions in case anyone out there has questions on them:

I've been using sessions for quite some time but only after reading this
do I really understand what is going on on both the client and server side.

Unfortunately, I still have some unanswered questions after reading it,
as it is pretty basic and gives a quick intro to sessions. For testing
purposes, I turned off all cookies in IE and attempted to sign into my
site on my local host, which uses sessions for signing in. In addition,
session.use_trans_sid = 0 in my ini file. I can't figure out how, but
somehow my scripts all still work and I am able to login fine, even
though cookies are disabled, as well as trans sid. How is my session id
being passed, as my understanding is these are the 2 possible methods?
There is no sessid propagated through the URL either, so it is not
through a get variable.

Also, I looked in my sessiondata folder and found a bunch of session
data. When I physically log out and kill a session, it removes it from
the folder. However, when I just close the browser window, it does not
remove the data from the folder. Reopening the browser right away
results in a new session and requires the user to login again, but the
old data from the previous session is still there. I checked my ini,
and found the default:

; After this number of seconds, stored data will be seen as 'garbage' and
; cleaned up by the garbage collection process.
session.gc_maxlifetime = 1440

But this isn't working as far as I can tell because I have session files
from days ago, and according to this it should be deleted after 24 minutes.

View Replies !

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