Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: saving data problem

by atcroft (Abbot)
on Oct 19, 2002 at 18:18 UTC ( #206542=note: print w/replies, xml ) Need Help??


in reply to Re: saving data problem
in thread saving data problem

Looking at the code again, I noticed you had (comments removed):

my $q = new CGI; my $action = $q->param('action'); my $month = param('month'); my $date = param('date'); my $year = param('year'); my $title = param('title'); my $message = param('message'); my $placement = param('placement');

I believe the issue is that you're retrieving them as my $variable = param('key'); when you should have it (I believe) as my $variable = $q->param('key'); for those lines. Try that, and see if it might take care of the issue for you. Just a thought.

Update (19 Oct 2002): In attempting to run the script from the command-line to figure out what else might be wrong, I received an error message about $placement not being defined, using the code you posted above. Did you leave out the code that set the value for that? Testing from the command line (-debug option required for this in the use statement for some versions of CGI.pm), when action was passed as 'add_event', what was written to the file was what I handed it for all of the other values. Are you seeing any error messages in your logs?

Update (19 Oct 2002): Something else I'm goig to ask just to ask, but I didn't see the elements you were passing in the form in the posting. Did you remove the <input> tags from the sample form? Those tags would have to appear between the <form></form> elements... Just thought I would ask...

Replies are listed 'Best First'.
Re: Re^2: saving data problem
by cal (Beadle) on Oct 19, 2002 at 18:41 UTC
    Thanks, No change. Still(::::::::)
Re: Re^2: saving data problem
by cal (Beadle) on Oct 20, 2002 at 01:04 UTC
    I am really sorry. I should have just included the html page. Better late than never I hope.
    <html> <head> <title>Add Event</title> </head> <body> <p><b><u><font color="#CC9900">ADD UPCOMING EVENTS</font></u></b></p> <hr> <table border="1" width="100%"> </table> <form method="POST" action="http://www.dom.com/cgi-local/homepage_upda +te/events/upcoming_events.cgi"> <table border="1" width="100%" height="93" bgcolor="#C0C0C0"> <tr> <td width="100%" height="87"> <table border="0" width="100%"> <tr> <td width="13%"><b><font size="5"> ADD EVENT SCREEN </font></b></td> <td width="87%"> <table border="1" width="100%" height="99"> <tr> <td width="12%" height="23">DATE</td> <td width="88%" height="23"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Month&nbsp; <SELECT size=1 name='month'> <OPTION value=January selected>January</OPTION> <OPTION value=February>February</OPTION> <OPTION value=March>March</OPTION> <OPTION value=April>April</OPTION> <OPTION value=May>May</OPTION> <OPTION value=June>June</OPTION> <OPTION value=July>July</OPTION> <OPTION value=August>August</OPTION> <OPTION value=September>September</OPTION> <OPTION value=October>October</OPTION> <OPTION value=November>November</OPTION> <OPTION value=December>December</OPTION> </SELECT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Date <SELECT size=1 name='date'> <OPTION value=1 selected>1</OPTION> <OPTION value=2>2</OPTION> <OPTION value=3>3</OPTION> <OPTION value=4>4</OPTION> <OPTION value=5>5</OPTION> <OPTION value=6>6</OPTION> <OPTION value=7>7</OPTION> <OPTION value=8>8</OPTION> <OPTION value=9>9</OPTION> <OPTION value=10>10</OPTION> <OPTION value=11>11</OPTION> <OPTION value=12>12</OPTION> <OPTION value=13>13</OPTION> <OPTION value=14>14</OPTION> <OPTION value=15>15</OPTION> <option value="16">16</option> <option value="17">17</option> <option value="18">18</option> <option value="19">19</option> <option value="20">20</option> <option value="21">21</option> <option value="22">22</option> <option value="23">23</option> <option value="24">24</option> <option value="25">25</option> <option value="26">26</option> <option value="27">27</option> <option value="28">28</option> <option value="29">29</option> <option value="30">30</option> <option value="31">31</option> </SELECT> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Year&nbsp; <SELECT size=1 name='year'> <OPTION value=2002 selected>2002</OPTION> <OPTION value=2003>2003</OPTION> <OPTION value=2004>2004</OPTION> <OPTION value=2005>2005</OPTION> <option value="2006">2006</option> <option value="2007">2007</option> <option value="2008">2008</option> <option value="2009">2009</option> <option value="2010">2010</option> </SELECT> </td> </tr> <tr> <td width="12%" height="39">TITLE</td> <td width="88%" height="39"> <p><input type="text" name="title" size="81"></p> </td> </tr> <tr> <td width="12%" height="19">MESSAGE</td> <td width="88%" height="19"> <textarea name="message" wrap= on rows="8" cols="70"> </textarea></td> </tr> </table> </td> </tr> </table> </td> </tr> </table> <input type="hidden" name="action" value="preview"> <p><input type="submit" value="Preview" name="B1"> <input type="reset" value="Reset" name="B2"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Place event at the&nbsp; BEGINING <input type="radio" value="beg" name="placement"> or the END <input type="radio" name="placement" value="end" checked> of existing events</p> </form> </body> </html>

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://206542]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2023-02-05 13:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (31 votes). Check out past polls.

    Notices?