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.





How To Generate Month Options In A Menu?


I'm trying to generate options in a menu that read

<option value="2006-03-01 00:00:00.0">March, 2006</option>
<option value="2006-04-01 00:00:00.0">April, 2006</option>
....
<option value="2006-12-01 00:00:00.0">Decmeber, 2007</option>

where the beginning is defined by the month/year of today's date and
the end is defined by a constant "FINAL_YEAR".

How would I generate the above menu using PHP 4?




View Complete Forum Thread with Replies

Related Forum Messages:
Use A For Loop To Generate The Options
I am designing a form, and one of the fields is for date of birth. I am having 3 select boxes. one for day, one for month and one for year. im wanting to use a for loop to generate the options. so for the day i would need a for loop that goes from 1 to 31.

here is the current code i am using, which works fine. note this line (<?PHP for($day=1; $day<32; $day++) {?>) Code:

View Replies !
Frames To Display Menu Options
I am just starting web development after a long break (6 years). Last time I was developing frames were often used to display menu options on the side of the page.
I was wondering as frames seem to be no longer used how would a menu bar on the left hand side of the website and possibly a bar along the top would be achieved in a php site?

View Replies !
Restricting Access To Menu Options
I'm building a very simple content management site that tracks
"tasks."

The options available are:
1.Add Task
2.Edit Task
3.View Task
4.Print Task

I need to restrict some users to only View and Print and I'm trying to
find a way to tell the page not to load the menu options (the text)
for those not having access to the Add and Edit functions. Code:

View Replies !
Setup A Page When You Open A Drop Down Menu Of Options
How do I setup a page when you open a drop down menu of options, select an option and then an image on the page changes to the selection you landed on. 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 !
Previous/Next Links As Month Names To Sort Listing By Month
I'm trying to build an event listing and realized that simply having previous and next buttons wasnt the best solution. Rather, I'd like to show the events by month and have the other month's events shown by following a link that would actually be the previous months name and next month name. Code:

View Replies !
Convert Date() Month Numeric Into Month Full Name.
date("m"); returns the following result for this month... "02"

That is fine and dandy, but the problem is, I need to change 02 into February, and not by changing it to date("F"); I need to use the date function to convert the supplied number of 02 into February, is there a way of going about this logically without a bunch of if/else statements??

View Replies !
Selecting Current Month In Month Select Dropdown
I have set up a simple dropdown to list all the months a year from now and for the past year, so form July 2006 - Jun 2008. However, I am looking to have the current month as the selected option when the user first sees the page. Any ideas on how to do this? Code:

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 !
Month Selection Dependant On Current Month
Basically I'm using a combo box to allow a user to select a month to see accounts stats for that month, so at the moment I am using the script below which will display all months up 1 less month than the current month (as obviously months after this do not have account details yet) However I want to allow the user to have a full 12 months to select from so if the current month was Feb 06 they could see Feb05, march05,April05.... up to Jan06... PHP Code:

View Replies !
Month Number Increases But Month Name Does Not
PHP Code:
for ($thisMonth = (int)$minMonth; $thisMonth <= 12; $thisMonth++) {
$monthName = date('M', strtotime($thisMonth));
print_r("thisMonth = $thisMonth and monthName = $monthName<P>");
}

Quote:
thisMonth = 7 and monthName = Sep

thisMonth = 8 and monthName = Sep

thisMonth = 9 and monthName = Sep

thisMonth = 10 and monthName = Sep

thisMonth = 11 and monthName = Sep

thisMonth = 12 and monthName = Sep

I am at a loss, please help, time sensitive I'm afraid, must be done in
an hour (it's 4pm EST now)

View Replies !
Month And Day Of Month Edit Fields
I wish to have a month select and next to it a day select.

Is there no way at all for the day field to pick up the selected month
without a previous submit on the part of the user?

View Replies !
Strtotime("-1 Month") Returns Day 1 Of Current Month
I ran this code today (October 31st, 2006) expecting it would return `9/2006`

<?php
echo date("m/Y", strtotime("-1 month")); // returns 10/2006
?>

Instead it returned `10/2006` and upon further investigation strotime("-1 month") is actually just rolling back to day one of the current month.

<?php
echo date("m/d/Y", strtotime("-1 month")); // returns 10/1/2006
?>

I wasn't expecting this behavior, and it somewhat broke the logic of a "expired credit card" validation I had on one site. It's pretty disturbing that I completely missed this in testing. :/

View Replies !
[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 !
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 !
Sorting Options
I have an array I would like to sort, but the sorting options that I have found are inadiquate. I need to do a case insensitive sort, that does not maintain the index correlation. My problem is I have some items in my array beginning with "a" and some with "A", and I want the sorting based strictly on the letter not the case, and then I have to be able to reference them in an order that maintains the sort.

View Replies !
Select Options
I am trying to pass some 'on the fly' list contents to a php handler script. The lists are created using JScript and I want to know how to get the value of the contents (not just the selected ones, but ALL the contents).

View Replies !
Php Web Payment Options
What would be the best way to add a credit card (and maybe also other
systems) payment option to my php website shop?

Is this something that can be done by a regular developer like me? And
if so where can i find information on how to do this.

Or is it customary/best to let a specialised company handle the actual
payment part of the transaction. And if so what can i expect to pay to
such a company for each transaction, and which are respectable
companies in the "Netherlands" region.

View Replies !
Dynamic Options
I'm creating an online database app for a dog grooming business. The problem I'm trying to solve at the moment is this: Each booking is linked to one customerEach customer may have more than one dogThe customer may bring more than one dog to be groomed

The problem I'm having is how to get this information into the database. I've spent quite a lot of time on the design side of the database and I'm confident it's structure is a workable one.

At the moment the user can select a customer from a drop down list. The ID of this customer gets put into the booking table. Along with this the time, date etc all get put in. Easy. However I'm not sure how I can let the user select which dogs are linked to the booking. What I'm looking for is:

The user selects a customerA list of the customers dogs is pulled from the MySQL databaseThe user can select as many dogs as they like from this list.

View Replies !
Recompiling Php With New Options
I've just installed php but after the installation I found that I should had compiled php with zlib enabled. I know that I can recompile php by doing ./configure with the new options but my question is: Is that all have to do in order to recompile php or do I need to change certain settings in php.ini file so that it may work with the options?

View Replies !
Insert Options
I choose this code for upload 3 files for certain directories but don't know how to do if certain file fields are empty(the files aren't obligator fields): Code:

View Replies !
No Encoding Options
I have installed phpMyAdmin on my service at pair.com and it works, except on other hosting companies there is normally an option to select the type of encoding when importing text files. For example if you set the language to Japanese (SJIS) and then go to SQL there is an option to import with EUC or SJIS encoding.

View Replies !
Radio Options
I am looking for a tutorial which would help me work out how to develop a php form i need to do. My form will select questions from a mysql database and display them accordingly on screen. For each question, there are a maximum of 5 answers, of which only one can be chosen (radio buttons).

But for some questions, the count of answers might only be 2, therfire only displaying 2 radio buttons but this might happen on the same page as questions with 5 options. I basically need a away of dynamically building the page when i select my questions and echoing the correct amount of radio buttons for each question.

View Replies !
Page Options
i been self learning the $_GET code but im trying to use it for id's how can i use this method if say :

68 /gid342/cid1110/WD/GM/1169845411ErhNBuxI5BJV5kVpgg... 2.47 2007-01-26 13:04:31 1169845411ErhNBuxI5BJV5kVpggoT

the above is my table and in table video i have from beginning to end ID - URLPATH - DURATION - TIME/DATE - VideoID

can the id contain letters is that a issue? also is there anyway to code out the letters?[if thats an issue of course] but my main issue is i want say like a tvworld.php?

View Replies !
Drop Down Options
I've got a drop down box which when I select the relevant item correcly updates the database but when I return to edit the form again the drop down is showing the wrong option even though the correct option is in the DB ....

View Replies !
Gallery Options
I am trying to create a gallery that limits to 5, the number of thumbnails on each row, and only allows for 2 lines of thumbs. i have more than 10 pictures per page though, but i don't know yet how to code those page numbers at the foot of the page to show that there are more pages 1 2 3 4 5 etc, with the page currently on being highlighted. CAn anyone advise me on how this code might look? my current code is:

<?php

$images = array();
$sql = mysql_query("SELECT * FROM news");

while($image = mysql_fetch_array($sql))
$images[] = $image;

$total = count($images);
for($i=0; $i<$total; $i++){
if($i % 5 == 0)
........................

View Replies !
Selection Options
I have a script where a user can go and update their details, the problem I am having is with a drop down box and retrieving the value: PHP Code:

<p>How many years working once fully qualified?:</td><td><select size="1" name="yearsasqualified"
<option value=&#391;' <?php if ($_POST['yearsasqualified'] == 1) echo "selected"?>>1</option>
    //<option>1</option>
    <option value=&#392;' <?php if ($_POST['yearsasqualified'] == 2) echo "selected"?>>2</option>

The problem I have is an undefined index on option 2 if say option 1 is selected.

View Replies !
SELECT * FROM Options

<?
$query = "SELECT * FROM options";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
$options_newaccount = $row["options_newaccount"];

echo "$options_newaccount";
}
?>

Can any one see any thing wrong with this?

View Replies !
Rightclick Options
I need help in javascript. I am looking for a scripts for disable view source in browser and disable right click option in broswe. I want script that need to work both in ie and firefox.

View Replies !
CURL_setopt Options
I've scanned through the list of options curl has to offer within PHP, and can't see one that limits the actual size of a download.

I'm looking to limit the size of downloaded files to 100 kilobytes.

A quick look at the curl.exe flag options brings this option:
-r/--range <range> Retrieve a byte range from a HTTP/1.1 or FTP server

Which I suppose could be used, but isn't supported by all servers.

Is there an option to limit the size of the download, or some kind of work around?

View Replies !
Str_word_count Options
str_word_count is listed as having three options, I don't see how the second and the third differ. I'm trying to use this to pull words from a comma or space delimited file (haven't decided which yet) and tryint to decide which I should use.

View Replies !
Particular Field Options
I have one web pages which will be the main page. I want to display certain field from the database into main page. I don't have any ideas on how to display the particular fields. I don't have any problem to display it in table.

<TABLE cellSpacing=0 cellPadding=3 border=0>
<TBODY>
<TR><TD vAlign=top colSpan=2><? display title from news table?></TD></TR>
<TR><TD vAlign=top width=80 rowSpan=2><? display image from news table?></TD></TR>
<TD class=announcedate vAlign=top> <P align=justify>
<? display description from news table?></P></TD></TR>
</TBODY></TABLE>

View Replies !
Question About Setting Options
I've been trying to get this to work for a while now, but I can't figure it out. Tryed out different suggestions, but can't get it to work the way I would like. Anyhow, I have a list of results I set in a table and at the top I have an option for entering min and max price and/or the option for sorting the table my name, price, or brand. Works great if I enter in a min and max value, but it returns an error if I don't enter in any values or enter in a non numerical value. Well, what I would rather have it do is not return an error and take me to the page using the options it does recognize and ignore the options it doesn't recognize or if it is empty. Here is my code:

if (!isset ($_GET['min'])) {
$min = $default_min;
} else {
$min = $_GET['min'];
}
$default_max = &#55613;&#57176;'
if (!isset ($_GET['max'])) {
$max = $default_max;
} else {
$max = $_GET['max'];
}
$default_sort = 'name'
if (!isset ($_GET['sort']) ) {
$sort = $default_sort;
} else {
$sort = $_GET['sort'];
}
echo "
<form method=get action=/$word/filter>
<table cellspacing=0 border=0 cellpadding=0 width=100%>
<tr>
<td align=left bgcolor=EEEEEE>
<input type=hidden name=category value="$fetch[category]">
<table border=0 cellspacing=0 cellpadding=2 width=485>
<tr>
<td><font color=#666666>Min Price</font> $
<input class=filter type=text size="5" name="min" value=""></td>
<td><font color=#666666>Max Price</font> $
<input class=filter type=text size="5" name="max" value=""></td>
<td align=left>and/or Sort by</td>
<td align=left><select name=sort class=select size=1>
<option value=name>Name</option>
<option value=our_price>Price</option>
<option value=brand>Brand</option>
</select> </td>
<td colspan=2 align=left><input type=submit value=Apply name=update style="color:#333333; background-color:#E0E0D0; font-size:11px;"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>

My query is like so:

$result = mysql_query("select * from evitamins_products WHERE category='$category' and our_price BETWEEN $min and $max ORDER by $sort ASC") or die (mysql_error());

View Replies !
Inputting Multiple Options
I need to input multiple options to 1 field in mySQL. The way it is set up now, it will only input 1 field and not multiples. mySQL is set up with the SET function and it works fine. I just can't upload from my web page and store the info. Anyone have an idea what I'm doing wrong here?

<input type="hidden" name="Type" value="$set$" >
<select name="Type" size=3 multiple="multiple">
<option value="All Communities">All </option>
<option value="Conventional">Conventional</option>
<option value="Golf Course">Course</option>
</select>

View Replies !
IF / ELSE Options In Mail Form
I have a form with the following fields:
-------------------------------------------------
Name
Email
Age (option field) -> over 45 or under 45
Sex (option field) -> male or female
Comments:
-------------------------------------------------

I currently submit this form to Formmail.cgi (Im sure you're familiar with it) and I get it in an email.

What I need to do is that IF:

- Age is Over 45 and sex is male then send "this" via email to the <email>
field and i want to receive an email with the results of the form.
- Age is Under 45 and sex is male then send "this" via email to the <email>
field and i want to receive an email with the results of the form.
- Age is Over 45 and sex is female then send "this" via email to the <email>
field and i want to receive an email with the results of the form.
- Age is Under 45 and sex is female then send "this" via email to the
<email> field and i want to receive an email with the results of the form.

View Replies !
With-curlwrappers Options For Curl
If I compile Php with-curlwrappers can I then set options for Curl
somehow?

View Replies !
Multiple Product Options
I've built a number of online shops with but I want to increase the
flexibility of the system that I use, mainly relating to product options.

Currently I just use an admin area to assign one or more options to a product
and these get displayed on the product page of the site, however what I really
want to do is relate those options so that only the options available are
displayed. This has my head in a bit of a spin as I haven't entirely decided
on the best way to do this.

My current thinking is to - in the admin area - list all the permutations for
a product each with a stock level form element, then when submitting the form
I use PHP to only grab the options that are available and store them in MySQL
as an string that can be eval'd when extracted and processed on the product page.

The product option drop-downs would be displayed in an iframe so that it can
refresh quickly based on the options chosen and what's available. I was going
to output a JavaScript array and use that but I want the system to work
whether JS is on or off.

Does this sound the best way to go about this or are there better more
efficient ways?

View Replies !
Are There Alternative Extension Options With .php?
Are there any alternatives to the .php file extension that will call
it, such as page.xyz? ....or does that need to be setup at the server
administration level, or is this not possible at all?

View Replies !
Js Options - Required Input
i m trying to figure out which javascript toolkit to use

i m now trying to figure out which to use between
The major contenders are:
Dojo
Mochikit
and prototype [rails fame]

View Replies !
Rand Of 5 Options Using % Chance
I want to create a random where by it knows the % chances of each then picks oen of the 5 by that % chance... so all can still happen of course.

Can this be done?

View Replies !
Setting How Options Are To Be Reported
Basically I'm working on a project that will go into publication soon. When I release it I'd like to create a system that will allow me to basically choose an alternative option to the general error report of the black text on the plain white backdrop.

I'm gearing towards a system that when encountering the error it just displays an error page and e-mails me the error. This will help eliminate some security concerns while the script is in use.

View Replies !
Possible To Reveal/hide Options
I have a form and based on certain responses, I'd like to show/hide other questions within the form *on the same page*. Is this possible?

For example, if I ask:
Do you like the color blue? Yes No
If the user selects no, the following is displayed:
Do you like the color red? Yes No
If the user select yes, the following is displayed:
Do you like the Smurfs? Yes No
(The Yes/No responses are actually radio buttons)

If this is possible?

View Replies !
Collecting Selected Options
how I can achieve the following:

Page1

Within form is a list of 100 questions each with their own checkbox, however the user must select to answer only 10 of these questions. So they select the 10 questions they wish to answer.

Page2

Then display the 10 questions they selected.

I believe this is something straightforward,just i cant get started.

View Replies !
Display Many Selection Options
Let's say I want my members to choose the state, county & town they live in. I could present a huge list box for them to select from but it would contain literally hundreds of items. That seems excessive. It would probably be better to present the states, counties & towns as levels in a heirachy of choices.

That is, you choose your state, then get shown a list of counties, then you choose your county then you get shown a list of towns in the that county. I could do that with a series of pages or reloads of the same page but surely there must be a more elegant way to do it. Must I use a javascript function for this or can someone suggest a pure php/html method?

View Replies !
Form Options Suggestion
I am hosting a youth sport site and I want to display schedules by select teams. how I populate the team selection in my statement:

$sql = "
     SELECT *
     FROM schedule_table
     WHERE division = '{$_POST['division']}'
        AND ( home_team = '{$_POST['team']}' OR visiting_team = '{$_POST['team']}' )";
My schedule is in a table with the following fields:
* division
* date
* time
* home_team
* h_score
* visiting_team
* v_score
* field

I thought that I would want a drop down menu to select one of our 35 divisions, then a secondary search by team of that previously selected division menu.  I have 35 divisions with over 300 team to select from.  It cannot be by team name alone, since there are quite a few teams from several clubs and they use the same name.  I would like to give my visitors easier time locating their schedules.What is the best option for visitors to create the WHERE variables?

View Replies !
Image Upload: What Are My Options?
I'm almost finished making a script that will allow an apartment broker to track apartment listings, landlord, and clients. I need to be able to add/delete/view multiple images for each apartment listing, but I need some advice for choosing a direction to go:

Add several more columns to the existing LISTINGS database, ie image1,image2,image3 (I don't like this idea because it will limit how many pictures a listing can have.) Code:

View Replies !
Autosetting Options In Dropdown
I use this code for creating an dropdown with preset options from a database: Code:

View Replies !
Credit Card Options
i was wondering if anyone can help me out?i have a dating website that only accepts paypal at this time,what i want to do is keep the paypal payment and add credit card payments to my site can anyone tell me how to go about doing this?thanks..(and if so is there away to make the payments from the credit card go into my paypal account?)


View Replies !
How Sessions Expire Is To Set Some Options In Php.ini.
I've seen a couple of questions regarding the
expiring of sessions in PHP. The way to control
how sessions expire is to set some options
in php.ini.

These options are of particular use:

session.gc_probability
session.gc_maxlifetime
session.cache_expire

session.gc_probability is a percentage. 1 means 1%,
and 100 means 100%. If you want to ensure
that the gc (garbage collector) is run on every
activation of the session subsystem, set
gc_probability to 100: Code:

View Replies !
Search Script Options
What woudl be my best option to add a search script to the site? someone has suggested entropy but I am finding it way too sloppy, my site has around 300 pages at the moment but will probably grow by 4 a week.

View Replies !
Javascript For Select Options
Here is my problem. mysql table A:

customer -- Address
ABC -- addr1
ABC -- addr2
ABC -- addr3
XYZ -- addr4
XYZ -- addr5

I would like to have 2 html select statement, 1st one, choose the customer ( dropdown for ABC or XYZ ), once the customer has been choosen, the second select will automatic come up the address for selected customer only.

View Replies !

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