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
See Related Forum Messages: Follow the Links Below to View Complete Thread
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?
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?
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:
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??
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:
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:
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)
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?
[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.
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.
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).
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.
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.
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?
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 = ��' 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());
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>
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?
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]
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?
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.
Setting Php Config Options In .htaccess
I got a problem setting php config options in .htaccess files (or in httpd.conf for that matter;). I'm trying to set the auto_prepend_file php.ini config option via the .htaccess file like this: Code: php_value auto_append_file "d:/web/test/auto_prepend/footer.inc" and it fails miserably: [Sun Nov 18 10:24:14 2001] [alert] [client 127.0.0.1] d:/web/test/auto_prepend/.htaccess: Invalid command 'php_value', perhaps mis-spelled or defined by a module not included in the server configuration I'm not sure where I'm going wrong here - does anyone know what needs to be done to be able to use 'php_value' in the httpd conf files? oh, PS I'm using apache 1.3.19 for win32 on a win95 platform, most things are ok, just this doozie... thanx for any help...
Doing A Split The Way I Used To Do It In Perl - Overwhelmed With Options
I'm trying to export data from a pipe delimited file (|) with php, trying to get away from perl entirely. My old perl script opens the file and sticks it in an array, then handles each line as a record in the database table by splitting the line like this: ($MLSNo, $Status, $DOM, $Address, $Unit, $City, $Area, $LP, $SP, $BT, $SqFt, $Bed, $Bth, $PB, $Gar, $Garno, $YrBlt, $TBMap, $Acres, $LotSqFt, $HOA, $Freq) = split (/|/,$i); How can I achieve the same with php?
Having Multiple Sort Options For A MySQL DB
I was wondering how you can sort MySQL rows in several different ways on one page using PHP. For instance, so that a user can click on a hyperlink to sort alphabetically, by price, by category, etc. Also, is it necessary to index each field in phpmyadmin that I want to sort?
How To Keep Or Save Some Display Options On Quanta
I'm using Quanta Plus 3.3.1 in Fedora Core 3 for my PHP editing, and I'm having a problem having it save my program settings. For example, I select "Show Line Numbers" and "Show Icon Border" and if I close and reopen the program, they're gone. I've looked all around for ways to save profile, or save settings, or the like and can't find anything like that. What am I missing? On a less important note, I also can't find a way to cascade the main window with the left-side windows for Document Structure, Scripts, etc. When I click on one, it opens a window on top of the main window, and then becomes completely obscured when I go back to the main window. I know it's possible, I've seen it set up to allow the left side windows to have a small constantly open window side-by-side with the main window. But I've looked all over, and I see no way to do it. Any pointers on what I'm missing,
Passing JVM Options When Using Php Java Extension?
I managed to get the Java extension working on php 4.3.10 after following various bits of advice from http://www.thelinuxpimp.com/main/mo...article&sid=419 and http://uk.php.net/java I have some Java code which runs fine from Java at the command line when specifying certain JVM options -Xmx and -Xms. I am now calling this class from php but can't see any way of pasing the arguments to the JVM created from the php process. Is there something in the jre or php.ini that I can edit to force these options, or is it hidden somewhere in the java extension source?
Options For Clearing Text Fields?
I am new to php and html. I'm modifying a journal article database application. Text field input (title, authors, journal, etc.) and associated pdf file are uploaded. Successful completion prints a sentence at the top but the text fields are not cleared. Headers have already been sent so I can't use header (right?). I want the text fields empty so the user can enter data for the next pdf to upload. Code:
Form Processing And Content Management Options?
I belong to an organization that needs to create a form by which people who want to present papers at a conference can submit their work for review. If they attach a paper, we would like there to be some kind of virus scan, but if we have them copy and paste the text of it in can it retain the paragraph breaks? Ideally they want the submitted papers (either from the attachments or the text field on the form) to be accessible online; secondarily they are OK with everything getting forwarded to one person's e-mail. Eventually they want to have this evolve into a content management system they can use to fully control and manage the paper submission, review and approval process, so if someone out there knows of a solution that could do this and we can start with now at the lower level that would be ideal. Based on my experience with PHP and understanding of how it works, I would like to do this in a PHP based system.
Pulling Options Lists From Mysql Tables
I've set up a form to load data into my db, but rather than hard code the options lists for three of the form fields, I'd like to pull that information from three lookup tables. This will allow whoever is inputting data to do a simple update for the three lookup tables, and speed enter the data into the form for the fourth (data) table without having to alter the code in the form. Here's the wish list. The three lookup tables have a key field and a description field. I want to display the description field content for selection by the user in the form (for example, from EventClass table, display "Single Pony" and return "1" to the CompClass field if Single Pony is selected Display "Pair Pony" and return "2" to the CompClass field if Pair Pony is selected display "Single Horse" and return "3" to the CompClass field if Single Horse" is selected (etc.) in EventScores), and have the key field content loaded with the data into the data table. Once I've figured the coding for one, I can duplicate the effort for the other two tables. I have seen PHP coding inserted inside php code. I've never seen this particular practice in any other language I've programmed in. Is this how a connect/query is handled inside a form which is inside a php script? <?PHP <form><?PHP ?> </form> ?> ?? To put it another way, I want to retrieve the data from a table and display it in the options box of the form. Then, when a option value is selected, I want the key for that value returned to the table in which data is being loaded.
Poll's Options - Two Queries To MySQL Or Unserialize()?
I'm making some changes in poll module. I don't know which method of storing options of poll is better. The main data of polls are in POLLS table. Speed and efficiency is the most important issue. There are 2 methods: 1. Storing options in ANSWERS table and executing 2 queries to get poll's data and options. Number of records connected with a poll in that table is equal to number of poll's options. Fields in ANSWERS table: Poll ID | Sequence (optional) | Option | Amount of votes 2. Storing options in another field in POLLS table. They would be being unserialized after getting data from database. Perhaps, it's faster method. Tests of serialize() and unserialize(): Seconds: 0.000138 | 9.5E-005 Miliseconds: 0.122 | 0.095
Framework For Creating Forms, Phplib Good, Are There Any Options?
I have been using phplib for a while and I really like the framework except for form creation. Maybe it is me but I in my opinion there isn't a good way to create forms or should I say, everything else is so well done that the way you create forms seems to be too cumbersome, in particular making it so that a pull down menu selects a value that you assign it. In any case, does anyone know of any php based (or other readily accepted web language) solution to creating forms?
Pre-selecting Options In Html-form According To Database Entry
I've got a html-form consisting - among other fields - of several drop-down-boxes and radio button groups. With this form you should be able to either create a new dataset or to edit an existing one. If the latter is the case, my application should propose values (the ones which are already in the database) and write them into the input-fields. My problem is, it should have the according options pre-selected and the checkboxes checked, and I've no idea how to do this. (Example: I've a dropdown box for languages, and my dataset says the language is English, then in my dropdown box the option "English" should be preselected when this dataset is to be edited).
Get Last Month
How can i know what is the last month..? or even how can i know what is month three months ago..
Getting Age With Month
I need to get accurate age of user with month from date of birth stored in mysql date is stored in mysql like this 1983-05-05 and i need to show age like this 23 year 11 month I have calculated years but months are not calculating correctly can anyone give some example how to calculate exact year and month.
Last Day Of Month
I want a function to determine the last day of the month. The function must actually calculate a date minus X amount of months (the months won't be more than 12 months) I've got the following: PHP Code:
Last Day Of The Month
I am developing a calendar. How can I get the last day of a month.. mean which days is it Sunday, Monday or. it should be in numeric form Like Sunday is 0, Monday is 1... etc.
Getting Last Day Of Month
I am trying to create a dynamic date that returns the last day for a month, depending on the month. PHP Code:
Getting First Day And Last Day Of Month
Hi, Using PHP 4, if I have a date, what is a function I could use to give me a date that represents the first day of that month? For example, if my date were "3/19/2006 8:00", I would want my function to return "3/1/2006 8:00". Similarly what function would I use to return the last day of the month? In the above example, the output I would want returned is "3/31/2006 8:00".
Last Day Of The Month?
Im having to do a bit of string manipulation and with the given values I need help trying to find out the last day of the month... Im passing the date format of: yyyymm (200706 being this month)(and im unable to change this for several reasons) and Im using substr to find the first 4 chars as the year and the last 2 chars of the month. With these two values I need to find the last day of the month (in this case last day of this month would be 30) At the end I then do an sql query where timestamp>=yyyy-mm-01 AND timestamp<=yyyy-mm-dd (where dd is the last day of the month value im trying to find.) Any ideas with the above issue?
Daylight Savings Time, PHP/Mandrake Linux, March 2007. Options?
I have an old machine running Mandrake 9.2 and PHP 4.3.1 hosting several websites. With the coming changes to daylight savings time in March 2007, what are my options in correcting the current calculation on this machine? Ideal option: RPM patch. Worst option: upgrade OS (it's a very old machine).
Timestamp + Month
I have a Unix timestamp and i want to add 3 months to that time and return the result as a Unix timestamp. How do i do that?
Week Of The Month
I need to determine the week of the month (1-5) so I can rotate menus for a cafeteria. Is the following, which I know prints the week rather than storing it, the simplest or easiest way to determine the week? PHP Code:
|