![]() |
|
|||||||
| Notices |
| Programming Forum Web and Software Programming Forum - Java, PHP, SQL etc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
I'm pretty new to PHP and WordPress, and I'm looking for a little bit of assistance.
My client is wanting to add a "Country" text box to the comment form area of their blog. (Right now, we just have "Name," Email," and "Website.") Here's how that code sits right now... HTML Code:
<input name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" type="text"><label for="author"><small>Name </small></label> <input name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" type="text"><label for="email"><small>Mail (will not be published) </small></label> <input name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" type="text"><label for="url"><small>Website</small></label> HTML Code:
<input name="location" id="location" value="<?php echo $comment_location; ?>" size="22" tabindex="4" type="text"><label for="location"><small>Country </small></label> EDIT: Sorry I can't seem to get the code to show as just plain text... Any help on how to get it to show up correctly...? Last edited by jeffross; 21-04-2008 at 10:42 PM. |
|
||||
|
|
|
||||
|
More than likely your code won't work because there's nowhere in the database to store that data. Unless of course wordpress creates database entries like that as needed... but i doubt it.
__________________
Subtlety is my middle name... and first and last in case you didn't get the point. |
|
||||
|
If there isn't a location in the database to store the data, then just make it. phpMyAdmin is really easy to use to add tables and associated fields to a MySQL database. If this is just a contact form, and the country field does not need to be stored, then just filter the country post variable value in your email processing script, and append it's value to whatever is sending the email.
As a php newbie, filtering data is one of the keys to being successful. Understanding validation and keeping your database, website, and emails safe is extremely important. Don't overlook this when adding the country field to your comment or contact form. Here is an example of filtering data in a contact form in a php 5.2.0+ script: PHP Code:
__________________
Brian's Web Design - Temecula Last edited by skunkbad; 23-04-2008 at 06:35 AM. |
![]() |
|
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Giving some life to photos by adding titles | axecity | Graphic Design Techniques | 2 | 24-04-2008 05:34 AM |
| adding a search box | philjohns | CSS Forum | 8 | 23-04-2008 04:42 PM |
| NEW BLOG COMMUNITIES to Promote Your Design Blog Topic | Graphic Design Blog | Graphic Design Blog | 0 | 14-02-2008 07:04 AM |
| Blue Web 2.0 Free Wordpress Blog Theme | Graphic Design Links | Graphic Design Links | 0 | 18-01-2008 03:50 PM |
| Ever1 knows that I can't code. | whitey-wonder | Graphic Design and Web Design Help | 9 | 21-03-2007 10:18 PM |
| All times are GMT. The time now is 06:55 AM. |
