TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 08-13-2009, 08:21 AM   #1 (permalink)
The Contributor
 
Join Date: Jun 2009
Location: Seattle, WA
Posts: 76
Thanks: 1
rguy84 is on a distinguished road
Default Making an edit script...

Not the best title but here it goes. I am making an application that is a touring schedule that books people for speaking events. The way I am doing the dates looks like this:

PHP Code:
<label for="startMonth" class="hide">Month</label>
    <select id="startMonth" name="startMonth">
    <option value="01">January</option>
    <option value="02">February</option>
    <option value="03">March</option>
    <option value="04">April</option>
    <option value="05">May</option>
    <option value="06">June</option>
    <option value="07">July</option>
    <option value="08">August</option>
    <option value="09">September</option>
    <option value="10">October</option>
    <option value="11">November</option>
    <option value="12">December</option>
  </select>
  <label for="startDay" class="hide">Day</label>
  <select id="startDay" name="startDay">
        <option value="01">1</option>
      <option value="02">2</option>
      <option value="03">3</option>
      <option value="04">4</option>
      <option value="05">5</option>
      <option value="06">6</option>
      <option value="07">7</option>
      <option value="08">8</option>
      <option value="09">9</option>
        <?php
                $i 
10;
                while(
$i 32){
                echo 
"<option value=\"$i\">$i</option>\n\t\t";
                    
$i++;
                }
            
?>
    </select>
  <label for="startYear" class="hide">Year</label>
  <select id="startYear" name="startYear">
  <?php 
        $yy 
Date("Y");
        
$i 1;
        echo 
"<option value=\"".date("Y")."\">".date("Y")."</option>\n\t";
        while(
$i 4){
            echo 
"<option value=\"".$yy++."\">".$yy."</option>\n\t";
            
$i++;
        } 
        
?>
  </select>
I can use mySQL to parse the date apart, but how do I tell the dropdown to select that value?

I have an admin page that lists the bookings, have an edit link after each booking. So if you click it you go to /editEvent.php&bookingID=(ID from DB). So if you click an event, you go to /editEvent.php&bookingID=6, I get the following error:
Quote:
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
What do I need to make this work? And what would I have to do so the right info gets presented?
__________________
Ryan | Blog | Twitter
Send a message via AIM to rguy84 Send a message via MSN to rguy84 Send a message via Yahoo to rguy84 Send a message via Skype™ to rguy84
rguy84 is offline  
Reply With Quote
Old 08-19-2009, 02:16 PM   #2 (permalink)
The Wanderer
 
Join Date: Aug 2009
Posts: 11
Thanks: 1
jasonberresford is on a distinguished road
Default

Umm shouldn't it be:

/editEvent.php?bookingID=6

not

/editEvent.php&bookingID=6

?
jasonberresford is offline  
Reply With Quote
Old 08-19-2009, 06:15 PM   #3 (permalink)
The Contributor
 
Join Date: Jun 2009
Location: Seattle, WA
Posts: 76
Thanks: 1
rguy84 is on a distinguished road
Default

yes it was a typo
__________________
Ryan | Blog | Twitter
Send a message via AIM to rguy84 Send a message via MSN to rguy84 Send a message via Yahoo to rguy84 Send a message via Skype™ to rguy84
rguy84 is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Coding conventions on making a small CMS Arye Advanced PHP Programming 1 08-11-2009 09:09 PM
Part 2: Giving our Currency Conversion Script some Responsibility Wildhoney General 15 03-17-2009 01:53 PM
Random Avatar Script FaceDancer Script Giveaway 1 08-22-2008 05:47 AM
hash() algorithm info script RobertK Script Giveaway 4 01-09-2008 03:00 PM
Need help outputting data (while making it easy to skin) Andrew Absolute Beginners 5 12-20-2007 01:52 AM


All times are GMT. The time now is 08:59 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design