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.





Dynamic Content Using Dropdown


I have the following dropdown menu which is populated by content or categories (with catID being the category ID) from the database. What I want to do though is when an item in the drop down list is selected, I want to show dynamic content under it. BTW, I must not emphasize on "dynamic" too much because it may seem like a DHTML thing going on here. For example, if a user selects a certain item/category in the list, I want content such as coupons in the DB which have the same catID as the category selected showing up.

The coupons are discreetly placed in the DB table "coupons" with the category ID being catID and...for eg:

catID --- couponname --- couponinfo --- expiredate

If you are going to include any kind of javascript, please write them as well. Here is the code I am starting off with:

===========================
<form name="myform">
<select name="selectID" size=10 > <? $resultcat = mysql_query("SELECT * FROM Category");

while ($myrow2 = mysql_fetch_array($resultcat)) {?><?printf("<option value=%s>%s</option>", $myrow2["catID"],$myrow2["name"]); } ?></select></form>




View Complete Forum Thread with Replies

Related Forum Messages:
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 !
Dynamic Dropdown?
I am posting a code for dynamic dropdown by Leon Atkinson, it works fine but i have a doubt: I tried to add another functionality to it where i got stuck! Once the city also gets selected from the second drop down i wanted that on clicking the submit button it should go to some html page wrt to the city choice. Code:

View Replies !
Dynamic Dropdown Box
im looking to have two drop down boxs one with makes of car and
the second drop down box to automatically populate with all the model
of that particular make of car. there are about 50 makes and upto 50
models per make.

I just would like to know the best way to do this - javascript or use
a database? it would be a lot of code todo it in javascript wouldnt
it?

View Replies !
Dynamic Dropdown
This may be rudimentary but I'm just trying to get my head around this without having to write a billion lines of extraneous code. I have a dropdown selection list, populated from a mySQL database, containing times in a HH:MM:SS format. The times are 30 minutes interval spanning an entire day, as in 01:00:00, 01:30:00, 02:00:00 all the way to 24:00. I have it entering fine into the database, but when I want to edit this time, I'd like to have the value in the database be marked as the CHECKED value on the dropdown so I don't have to manually re-enter the time for every edit.

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 !
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 !
Three Dynamic Dropdown Boxes
Can any one help me in dynamic drop down creating? I have three dropdowns One for Country one for state and one for location. My plan is to select the country from dropdown according to this i have load the values in state drop down from MySql table. Depending on the state i have to select the location too.

View Replies !
Selecting Initial Value On A Dynamic Dropdown Box
I have a drop down box and am trying to figure out how to select the initial value from the results of a query on my page. Code:

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

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 !
Dynamic Dropdown List Using Access
I am creating a dropdown list that is populated from an Access DB: Code:

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 !
Assign Dynamic Dropdown To Variable?
Is it possible to assign a dynamic dropdown script to a $variable? Code:

View Replies !
Dynamic Fill Form Fields Depending On Dropdown Box
This question has probably already been asked, but let me ask again

I have a mysql database to which I connect with my php scripts. The
database contains articles. Name, Unit_Price and Reference

Now my client needs to order 5 items, click a button and a table with 5
lines and 3 columns appears (until now easy)

In the first column is a drop down box with a <select > and <options> in
which I store all possible names.

I would like than whenever the client changes one of the boxes (in my
case there are 5) the Unite_Price column and Reference column in the
line he just choose get automatically updated

View Replies !
Creating Dynamic Page Based On Dropdown Selection?
I'm using Dreamweaver, but I believe this is a general PHP/MySQL question. I have a table, with 4 fields: id, year, car_make, car_model. The data looks like this:

1 1992 Honda Civic
2 1994 Ford Probe GT
3 1999 Audi S4
4 2002 Porsche 959

On my web page, I have a drop down list that's propogated automatically with the "car_model" field entries which are pulled from that table. So when I click the down arrow, I see Civic, Probe GT, S4 and 959. Code:

View Replies !
Data Entry Form With Dynamic Dropdown Boxes
I am working on a Form for user to register & enter their info such as name, email, address, tel etc. and I put in a couple of dropdown boxes namely country and city where user can select. I made them dynamic, i.e. the city dropdown is based on the selected value from country and the data retrieved from MySQL database.

The problem I have is the Javascript script involved a reload of the form and once I select a value from Country, the city dropdown populated with data OK but the data entered beforehand (Name, email, etc.) disappeared.

View Replies !
PHP Dynamic Drop Down Menus, Page Displays Diff Data Depending On Dropdown Selected.
I currently have two drop down menus the first one with countries and then the second one changes depending on which country is selected to display counties.

This works fine, now what I want to do is have it so when it county is selected it shows all the squash clubs that are in that county below the drop downs. Code:

View Replies !
Dynamic Content In A <div>, Using Php
i have a <DIV> block, and I want the innerHTML to change at the click of a button. for those who don't know some javascript, if you have a dive with an id, <DIV id="myDiv"></DIV> you can change the content inside with a function call

myDiv.innerHTML = "some stuff";

however, i need my data to come from a mySQL database and thus needs to be outputted via php. so ideally i want something like

myDiv.innerHTML = "<?php echo "some stuff"; ?>";

of course that does not work because php is not client side, this is just to illustrate what i want. any ideas on how to do this without iframes?

View Replies !
Another Dynamic Content
I know this topic has been talked about many times but I searched the forums for hours and can't find a solution (another newbie). I want to build a menu with 6 links and when you click on the link.

the information below the menu in a lower row gets updated (pulled from another php or html file)that's it. I know it's simple but if you could point me in the right direction I would greatly appreciated.

View Replies !
Dynamic Content
I work for a design company as an intern doing strictly design, however, I'd like to learn PHP for my own personal use.

I'd just like to know where I should start with setting up dynamic content. Meaning, a site that has variables or something of the sort, where the webmaster can log in and change content from a panel of some sort.

Maybe I'm jumping into this too quickly, but I've already taken C++ and other languages that make reading php understandable.

View Replies !
Dynamic News Content
Is there any sample application with source for creating dynamic news contents using PHP and some relational database?

View Replies !
Dynamic Linking In Content
I have a query. What I am trying achieve is to do some on the fly linking. What I have is some content from a DB, and within the content if a particular word appears then I would like to insert a link to the product page.

Now I'm not quite sure the best way of implementing this. whether I should create a keywords table in the DB and then compare the content with the keywords table?

Any suggestions or examples of code?

View Replies !
Web Crawlers And Dynamic Content
This must be a very old and well studied question...
I created a site using JSP, that permits the viewing of articles that
are fully stored in a database. The url for the articles is something
like:
.../article.jsp?idi=6&ida=12
My question is, and this is the same for all dynamic content
technologies (server-side scripting technologies): is there a way to
permit for search engines and crawlers (Google, Yahoo...) to find and
categorize these article pages?

View Replies !
Dynamic Link/Content With PHP
I've created a mySQL database with the fields id, title and content.
'ID' is a unique field. Any ideas on how I can use PHP to generate a
list of the titles which are links. When you click on a link you are
taken to a page with the content held in the database. I'm guessing the
generated links would be something like /page.PHP?pageid=x based on the
id, that's if this script is possible at all.

View Replies !
Generate Dynamic Content
I have an home page, there are three links : news1, new2 and news3. and then I have one page to display the news, display.php. Can I display news1,news2,news3 in display.php. So I dont need to make 3 different page (display1.php, display2.php, display3.php) to display 3 different content (news1, new2 and news3)I want to make it dynamic.

View Replies !
Dynamic List Content
i'm making a hierarchical Order list for this i've created database where
parameter_cd,parameter_desc,upper_parameter_cd my page is like this Code:

View Replies !
Copyrights And Dynamic Content
Has anybody here ever copyrighted a dynamic website? I'm an internet publisher and my website stores small business ideas and related information in a mySQL database. We add content (our own) to the database almost daily.

I'm not asking for legal advice, just seeing if anyone has done this and how they went about it (i.e., worked with a lawyer, filled out the forms through US Copyright office, used a copyright service, etc).

The closest guidance I could find from the US Copyright Office is contained in Circular #65 - Copyright Registration for Automated Databases (http://www.copyright.gov/circs/circ65.html). However, their definition of an automated database is the compilation of pre-exisisting materials or data into an original form. Not sure where original content fits in?

If anybody does have experience with this, the follow-on question is, how frequently must follow-up copyright submissions be filed to accomodate the expanding database.

View Replies !
Java, Dynamic Web Content, Serialization, Web Dev
I noticed a post that mentioned PHP does a better job of dynamic web
content than java and wanted to see what people have to say about that.
Also, I saw it mentioned that in PHP you don't have to mark objects as
serializable and sessions are more transparent with or without cookies.

I've done some java but am mainly a C++ programmer at this point, but
want to start reading up on web development. I have to find my big
thick Java book, someone may have borrowed it. I got into doing alot of
perl for automated testing and started reading perl/CGI, various perl
web stuff and PHP books.

Maybe I should go back and focus on Java more, and then see if I want
to play with PHP. Can you find free web hosting that has perl/java/php
support ? Is it worth building my own web server with Apache ? I am
mainly interested in furthering my programming skills. I would think
getting an apache web server running would give me more admin skills.
That might be good if I wanted to do my own freelance work. I would
like to be able to have a flexibale work schedule, do some part time
work etc. I'd also have to buy another computer probably to install
apache on.

Is the difference between Java and PHP sort of like the difference
between C++ and perl ?

View Replies !
Split Dynamic Content PHP Or Javascript
I have been working on a new site for ages trying to come up with a good way to cleanly split up content using PHP or Javascript.

Basically what I want to do is split dynamic content that includes links in to certain length chunks and not just cut off the string in the middle of a link. The length will be determined by the current users font-size.

Is there a PHP function that does this by any chance or do you know of one, javascript also.

View Replies !
Php Meta Descriptions With Dynamic PHP Content...
I have been very interested in using dynamic (db driven) meta page descriptions. I know that search engines use these at a minimum these days, but will they be able to read these dynamic descriptions. I guess I am not sure how these spiders work... Do they simulate users bwosing the site or are they indexing them by scanning actual files (in which case dynamic meta tags would be pointless).

View Replies !
Dynamic Content - Meta Tags
I have some simple dynamic content pages (included below). I need to
know how to add specific meta tags (ie. description, keywords, ect.),
as well as extra specific header coding to a page. I would like to
have these on the Links page. Is this possible? and how?

View Replies !
Replacing Strings With Dynamic Content.
I am writing a template function, and want to replace a string such as <*price*> With the value that price is a MySQL database. For example, I have a page that is
page.php?cid=3 Code:


View Replies !
Sockets To Serve Dynamic Content
I know it is possible to send a web page to someone's browser through the socket as a response to their connection. Let's say the page you serve them has a link with GET variable attached or a form with POST variables, and you want to use that information to calculate your next response to them. How does one go about doing that?

I've tried just using $_GET['variable'], etc within the php script but no luck with that, however when the user first directs the browser to the socket, they are sending headers.

Am I supposed to use regular expressions, etc to parse the headers and extract the information from get and post or is there some easier or better way to do this?

I've seen lots of examples from google on how to send a response on the socket from telnet, but nothing about how to create some sort of browser interactive response. Any body able to help out with this?

View Replies !
Cached Pages And Dynamic Content
I am currently building a caching mechanism into my own development framework.

Basically whenever a page that is marked in the DB as cacheable is requested the controller creates the cached version of the page and returns it , on subsequent requests the cache is displayed.

Whenever a content change is made in the DB the relevant cached page is deleted ready to be rebuilt & cached with the new content on the next page request.

Thats fine for many pages , some pages are too dynamic for caching to be useful (shopping carts for example);

.................

The issue I am grappling with is .....

A product information page, mostly static and perfect for caching , but lets say the user has something in thier shopping cart I want to also show a 'checkout' now link or change the 'buy now' links to 'add to cart' etc.

e.g. some small content will change and so I can't use the existing cache.

the choices to date seem to be ...

View Replies !
Create And Dispose Dynamic Content
I am trying to figure out how to have a script dynamically create and then dispose of a text file. A script will generate a text file using the standard I/O functions and then present a link so the user can right-click and download. That part is easy. The file could be created in a unique directory on the server for each user such that different users don't clobber each other.

How can I make sure the file is later removed if the user backs out of the page and doesn't explicitly logoff. I suppose it boils down to is there a way to write a script that gets executed when a session ends whether the user explicitly logged out or not.

View Replies !
Creating Dynamic Content For A Website
What I want to create is a gallery of posts, perhaps text files in a single directory on my website, and allow the user to scroll through them with "back" and "next" links. I hate the idea of creating individual html files with the content posted in the body of the file.

Is it possible to use php to post this content dynamically from a directory of txt files, with no hardcoding, so the previous or next post just appears on the page with no reloading? If so, can anybody direct me to a tutorial on how to accomplish this?

View Replies !
Dynamic Content - Writing DB Info To A Page
I'm writing a website that works on similar lines as a dating site, where end users can enter their details and what they want to sell, which is then submitted on to a webpage, any people that are interested in that product, contact us and we then pass the lead to the person who is doing the selling. So basically teh site is acting as a middle man.

I have done the database bit where the end user enters his details, we get emailed his details and his id (which is a an auto increment field) then there is a page called view.php which pulls up his details on a web page and there is then a submit and decline button. Teh decline button is the easy part, but the bit that I'm stuck on now is the submit part. And thus here is my question how do i write information that is held on a database to a webpage. But this webpage has to ADD and and not OVERWRITE what is already there as we want to create a listing? Code:

View Replies !
Include Files Dynamic Content From Subdirectory
I am trying to use different (dynamic) content based upon the choice in a simple menu, here is what I have so far (see below), it works fine as long as the include files (a.inc, b.inc, etc...) are in the root directory, what I want to do though is keep all the include files in a subdirectory called includes, I am not familiar enough with PHP to change the code to make this work. Code:

View Replies !
Problem With Browser Caching And Dynamic Content
I'm using an image rotator PHP script that randomly rotates 1 png image and 5 gifs. Firefox and Gecko engine browsers cache the first image that it loads and keeps it that way, even when refreshed (when its supposed to display a new image).

IE does not have this problem. Does anyone have like a no-cache or an always-revalidate script? Obviously, the src looks like this <img src="rotate.php" alt="blah blah">.

View Replies !
Wrap Dynamic Content In A Static HTML File
I am currently working ona site whoch uses logins and sessions... I am trying ti implement the use of fast Tamples class which will allow me to wrap my dynamic content in a static HTML file. However the problem is:-

Warning: Cannot send session cache limiter - headers already sent (output started at
welcome2.php:1) in /lib/check_session_php.lib on line 3

The check session is an include to check for a valid session, thata user has created upon successful log-in... Anyone familiar with the fast templates class and could possibly help me debug this problem.

View Replies !
Dynamic Content - Current Currency Exchange Rate.
I have a page that does conversions. The only thing that doesn't stay the same is the current currency exchange rate.

View Replies !
Typo3: Generate Dynamic Website, Show Only The Pages That Include Content
i want to create a web form where someone can do some input or pick
strings from select boxes. after that the person can click a preview
button and a website will be generated dynamically. so i thought i
should use typo3. first of all i created a html-template. then a page
tree with all the sites that could possibly appear. in the end only the
sites with content, will be shown. all of this must happen
automatically. so i need a php script or a typoscript that compares the
"pages" table with the "tt_content" table. after that the attribute
"hidden" in the "pages" table should be "true" for the pages that
doesn't contain any content.

does anyone have an idea if this is possible or if typo3 is the right
choice?

View Replies !
Use A Content Type Application/zip, And A Content Disposition With The File Name (test.zip)
I was able to use Ethor's suggestion to fix a problem I'm having. My
original problem was that I was missing the quotes around the
filename in the CD header. I've read the ensuing dialog between Ethor
and JD and have a question/comment driven by the fact that things
don't seem to work for me the way they're "supposed to" and I wonder
why.

I use a content type application/zip, and a content disposition with
the file name (test.zip) just like JD suggests. But it only works if
the HTTP request ends with ".zip".
My request is
http://a.b.c.net/cc/production.php?file=123&zip=.zip
I get a valid zip file downloaded, but the filename isn't the filename
in the CD header - its cc.zip.

Furthermore, if I make the request
http://a.b.c.net/cc/production.php?file=123&zip=
(no .zip on the end, which is what I wanted it to be), it doesn't work
at all. The dialog box that pops up is making the filename
?file=123&zip=

(Note: I'm using IE as the browser. My server is remote from where I
am, and I go through all kinds of route point and a VPN to get to the
server. Also note that this works when I browse to my local machine.)

I've tried various combinations of application/zip, octet-stream,
lower/upper case, quotes/no quotes, order, etc. All have the same
result described above. The only two headers I specify in PHP are the
CT and the CD.

I making a SWAG that some device between my browser and the remote
server is monkeying around with the request and/or response headers.
Otherwise why would the response headers that my PHP application has
correctly applied? Is there something in the Apache or PHP
configuration I need to look at?
http://eye.cc php newsgroups

View Replies !
Using The 'Content-type', 'Content-Disposition' And 'readfile'
I've been facing a problem I couldn't solve, I don't know how to serch for it in the list's old messages, so I'll tell you what it is and see if you can
help me. I have this lines:

if (isset($_GET['download']) && ($_GET['download'] >= 1)) {
if ($_GET['download'] == 1)
header('Content-type: application/doc');
else if ($_GET['download'] == 2)
header('Content-type: application/rtf');
else if ($_GET['download'] == 3)
header('Content-type: application/pdf');
header('Content-Disposition: attachment; filename="' . $_GET['file']
. '"');
readfile($_GET['file']);
}

It should show to the user an dialog to the user, so he can choose to
save the file or to open it directly. The dialog shows and the user chooses, and here comes the problem, by using the 'Content-type', 'Content-Disposition' and 'readfile' the content of the page I'm in is "attached" to the end of the file I'm downloading. When it's an DOC or RTF file, the content of the page
doesn't affect the funcioning, but if it's an PDF the string taht goes
"attached" in the end of the file happens to make the file useless.
All I want to do is to use some routine to let the user choose to save
the file or to read it directly, nothing more, nothing less.
I have been trying to solve this problem for at least some weeks, and
I couldn't find some information that could really help me.
BTW, at php.net I found the following example:

<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');

// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');

// The PDF source is in original.pdf
readfile('original.pdf');
?>

I used (as can be seem) this example with some modifications, but not
too much, and it happens that it's useless for my needs, if someone
knows how to fiz it or some other way to do what I want please let me
know, I'll be very grateful.

View Replies !
XML Content Syndication And Content Management System
I have several folders of news stories in XML format on my server running PHP, MySQL, apache. What's the best way to dynamically grab the xml files and display them? Is there an existing news content management system that would allow me to specify which XML stories I want displayed? Allowing me to QC news stories and approve/ban them via an admin screen?

View Replies !
Dynamic Variables To Dynamic Form
I have a form method="post" generated dynamically bu a "for".

<form action="" method="post">
<?php
$total = 10 //custom value
for($i=1; $i<=$total; $i++)
{
$subdata=explode("][",$data[$i]); 
echo "<div>$i:
<input type="text" name="opt[$i]" size="40" maxlength="40" value="$subdata[0]" />
<input type="text" name="img[$i]" size="25" maxlength="50" value="$subdata[1]" />
<input type="text" name="num[$i]" size="4" maxlength="4" value="$subdata[2]" />
</div>";
}
?>
<input type="submit" value="Submit" />
</form>

It's ok in php 4, but in PHP 5 doesn't work.
How to generate the variables to make the code php5 compilant? Code:

View Replies !
Looking For Dropdown Help
I have a dropdown in which i want it to open a soundfile when selected. So, how do I go about this. The form will get submitted, and through a series of conditional statements it will point the right selection to the right if statement. but what do I put in the if statement to get it to open a realplayer with my ram file?? Here's what I got so far.
Code: <FORM ACTION="<?=$_SERVER['PHP_SELF']?mode=changedropdown?>" METHOD="POST" NAME="sermondropdown">
<P>
<SELECT NAME="sermons" SIZE="1" onchange="this.form.submit();">
<OPTION VALUE="pleaseselectasermon">Please Select a Sermon
<OPTION VALUE="082403Daniel_1_1-8">August 24, 2003 Daniel 1:1-8
<OPTION VALUE="083103Daniel_1_1-8">August 31, 2003 Daniel 1:1-8
</SELECT></P>
</FORM>

<?
if('changedropdown' == $_GET['mode']) {
$selection = $_POST['sermons'];
if (?Daniel_1_1-8' == $selection) {

} elseif (?Daniel_1_1-8' == $selection) {

}
?>

View Replies !
Dropdown
I have a dynamic drop down that needs to be populated from different columns in a database. The problem I'm running into is that sometimes fields do not have a value. So I would rather those didn't print out. The code below prints out the blank fields.

I know I need to loop through and check for an empty value, but I'm drawing a blank on the how part. Code:

View Replies !
Dropdown Possible With PHP ?
i'm looking for a way to do the following :

1. selecting data from a MySQL database
2. putting one field into a dropdown
3. after selecting a value from the dropdown follow some more php code

step 1 is no problem, step 2 is no problem with the html select statement however this leaves me on the client side. After this i'm not able to return to the server side to execute some more php code, with the onchange attribute i can start some javascript but i want ( read need ) to use php code. Concrete question : is there a way to create a dropdown in pure php code ?

View Replies !
Value In A Dropdown
I have a piece of code where I get the player_id value from the url at the top of the page. Rather than this I want to get the value from variable named $player_one. Code:

View Replies !
Dropdown Box
I want to create a form with a default image and a below it, dropdown box and a series of options in it. When the user clicks on the submit button after selecting their option, the default image above the box is replaced and a title or caption next to the new image would appear.

For example the user might select 'option C' from the drop-down list. They then click submit. The default image would be replaced with the selected option or the page would reload with the new image and a title or caption next to the image.

View Replies !
Dropdown Box Is Too Big
I want to know the code to restrict the dropdown box to a certain number of characters as the data from the db is too big. I want it to display say 50 characters.

View Replies !

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