Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Programming & Scripting (http://www.greenguysboard.com/board/forumdisplay.php?f=15)
-   -   Making a field required in DragonList (http://www.greenguysboard.com/board/showthread.php?t=56374)

LD 2010-02-10 11:44 AM

Making a field required in DragonList
 
My coding skills are very minimal, but I was thinking there might be some way, perhaps in mysql admin, to make one of the user input fields required. It's a pretty common script around here, so maybe someone has alreadt figured it out...

HarryM 2010-02-12 10:04 PM

Got a URI to the input form? Since it's someone else's script client side would be the way, but if their code is not obfuscated post it here and I'll fix it.

\n".
                "\n".
                "\n".
                "\n");
}               
print("\n".
        "\n".
        "
LD 2010-02-14 07:24 AM

Here's the form.

http://www.lusciousdelights.com/link...ers/submit.php

I was hoping to require user to put something in one of the three fields "movies, pics, or other" so it would not be blank. But on second thought, maybe it's not such a good idea since I accept blogs.

I think this is the code for the input:

Code:

// Get the site elements
// Make the elements field back into a usable array
$elements = explode_assoc("=",",",$site->elements);
$result = DoQuery("select eid as id, element_name as name from dl_elements");
while($element = mysql_fetch_object($result)) {
        $i = (int)$element->id;
        print ("
\nNo. of " . $element->name . ":\n\n\n
\nSite Type:\n\n

Maj. Stress 2010-02-14 12:59 PM

LD you could add a site type "blogs" and put the include on the free site pages. I use flv's on my blogs so I just submit them as having 10 vids since I have 10 posts per page.

HarryM 2010-02-15 09:46 PM

That PHP code you posted is just priting the submit form, you can't validate input at this stage.

This would work though (on client side), I commented it so you can change it to suit.

Code:



HarryM 2010-02-15 09:49 PM

Change your submit form's html to this BTW:

Code:



LD 2010-02-16 09:19 AM

Thanks, I'll give it a shot. I know enough code to be dangerous, but that looks like it should work.

acluett89 2010-02-20 12:59 AM

The package you need to install is most likely called "php-mysql" You will also need "MySQL-client" In any case, "yum search php mysql" should get you the relevant packages.

DIVAD3 2010-02-26 12:38 PM

Inserting Table Question???
 
This post seems fitting to a question I have on inserting a table!
I am inserting this table into a godaddy database:
Quote:

CREATE TABLE IF NOT EXISTS `users` (
`id` bigint(20) NOT NULL auto_increment,
`md5_id` varchar(200) collate latin1_general_ci NOT NULL default '',
`full_name_company_name` tinytext collate latin1_general_ci NOT NULL,
`dealer_tax_id` tinytext collate latin1_general_ci NOT NULL,
`assigned_state_dealer_id` tinytext collate latin1_general_ci NOT NULL,
`street_address` tinytext collate latin1_general_ci NOT NULL,
`state` tinytext collate latin1_general_ci NOT NULL,
`zip_code` tinytext collate latin1_general_ci NOT NULL,
`phone` tinytext collate latin1_general_ci NOT NULL,
`fax` tinytext collate latin1_general_ci NOT NULL,
`website` tinytext collate latin1_general_ci NOT NULL,
`user_name` varchar(200) collate latin1_general_ci NOT NULL default '',
`user_email` varchar(220) collate latin1_general_ci NOT NULL default '',
`pwd` varchar(200) collate latin1_general_ci NOT NULL default '',
`address` text collate latin1_general_ci NOT NULL,
`state` varchar(200) collate latin1_general_ci NOT NULL default '',
`tel` varchar(200) collate latin1_general_ci NOT NULL default '',
`fax` varchar(200) collate latin1_general_ci NOT NULL default '',
`website` text collate latin1_general_ci NOT NULL,
`date` date NOT NULL default '0000-00-00',
`users_ip` varchar(200) collate latin1_general_ci NOT NULL default '',
`approved` int(1) NOT NULL default '0',
`activation_code` int(10) NOT NULL default '0',
`banned` int(1) NOT NULL default '0',
PRIMARY KEY (`id`),
UNIQUE KEY `user_email` (`user_email`),
FULLTEXT KEY `idx_search` (`full_name`,`address`,`user_email`,`user_name`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=50 ;
HERE IS A PHOTO SIMILIAR To Go Daddys database:
http://www.jenna-teens.com/misc/database1.jpg

At the bottom of the database it has only this remaining which is cut off from the diagram which you see: Note: l BOX l = is referring to a box to insert info.
Quote:

TABLE COMMENTS STORAGE COLLATION
l BOX l l BOX l ENGINE
l MYISAM l=drop down l BOX l
BOX
Then it has these notatations as follows:

1 If field type is "enum" or "set", please enter the values using this format: 'a','b','c'...
If you ever need to put a backslash ("\") or a single quote ("'") amongst those values, precede

it with a backslash (for example '\\xyz' or 'a\'b').

2 For default values, please enter just a single value, without backslash escaping or quotes,

using this format: a
-------------------------------------------------------------------------

So my question being this. Where do I enter this bottom portion of the table that starts with:

PRIMARY KEY (`id`),
UNIQUE KEY `user_email` (`user_email`),
FULLTEXT KEY `idx_search` (`full_name`,`address`,`user_email`,`user_name`)
-------------------------------------------------------------------
FROM HERE DOWN It has a place to enter this info:
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci AUTO_INCREMENT=50 ;
------------------------------------------------------------------------
Can anyone tell me where do I insert the bottom portion of this table????


All times are GMT -4. The time now is 08:29 AM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc