Help - Search - Members - Calendar
Full Version: [resolved] Part 2 of the BAB series
Codegrrl.com Forums > Script Help > Tutorial Help
Billy
There's an error on the whole code in Part 2: Post to Your DB in the BAB series. I couldn't post a comment there, so I'm taking it here. tongue.gif

It says there:
QUOTE

<?php
$current_month = date("F");
$current_date = date("d");
$current_year = date("Y");
$current_time = date("H:i");
?>

<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

<p><strong><label for="month">Date (month, day, year):</label></strong>

<select name="month" id="month">
<option value="<?php echo $current_month; ?>"><?php echo $current_month; ?></option>
<option value="January">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>

<input type="text" name="date" id="date" size="2" value="<?php echo $current_date; ?>" />

<select name="year" id="year">
<option value="<?php echo $current_year; ?>"><?php echo $current_year; ?></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">2008</option>
<option value="2010">2010</option>
</select>

<strong><label for="time">Time:</label></strong> <input type="text" name="time" id="time" size="5" value="<?php echo $current_time; ?>" /></p>

<p><strong><label for="title">Title:</label></strong> <input type="text" name="title" name="title" size="40" /></p>

<p><textarea cols="80" rows="20" name="entry" id="entry"></textarea></p>

<p><input type="submit" name="submit" id="submit" value="Submit"></p>

</form>


But for the Title shouldn't it be:

<p><strong><label for="title">Title:</label></strong> <input type="text" name="title" ID="title" size="40" /></p>

And I've got some questions too.

If you added a Mood and a Music option, how are you supposed to display those? smile.gif Thanks a bunch!
Steven
First finish all the parts to the tutorial. Don't just copy and paste it. Actually take the time to read and understand the code. At the end, after you finish the categories mod, I think you can modify the category code to add support for music and mood. You can also just add more fields to the Database and manually add them in with a text box,.
Amelie
Yes, it should be id="title". Must have been a typo... Unfortunately only Vixx and Sasha can edit the tutorials so we will need to wait until they have time to do this.
Billy
Okay. Well I had an error with the script for posting to my database. Here's the error:
Parse error: syntax error, unexpected '?' in /home/iheartyo/public_html/shotgundeathwish/post.php on line 61

:/
loadx
post your code.. that code above isnt even 60 lines long.
Billy
No thanks. smile.gif I fixed it already. Thanks for the help anyways!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.