In a nutshell, my company is using several different programs that use a string of data regarding personal appearance information for different TV/movie character. This data need to be read in a very strict manner. (The following example is exactly how we need to input the information... including all brackets and greater/lessthan symbols.
Example:
[Performer=Character]..... etc...etc...etc...
[Sylvester.Stallone=Rocky.Balboa]..... etc...
Currently, my boss has half the company using shortcut keys to type all of this in manual. Absolutely ridiculous!!! So over the weekend I broke out my old HTLM/Javascript books and tried to make a simple webpage/form w/ multiple dropdowns or checkboxes that will hopefully speed up the process. The input dropdowns/checkboxes are at the top of the page w/ a box at the bottom that will post the correct string (including proper brackets,periods,<>,etc).... with a "Generate" and "Reset button in between. I'm using PHP (process.php) to process the data, put it in the correct order and then post it back in the box (treated as a separate page.) The problem I'm having is the the Javascript strips away the < and > (greater/lessthan) symbols no matter what I try. I can't get it to post the data w/ these symbols attached. It just treats is as code and posts only the words.
I haven't tried programming in quite some time... so any and all help is greatly appreciated!!! If there's a simpler/easier method, I'll start from scratch if need be. But preferably I'd like to find a simple fix and be done with this.
Thank you!!
DaFunkyBeats
.. etc...etc...etc...
[Sylvester.Stallone=Rocky.Balboa]..... etc...
Currently, my boss has half the company using shortcut keys to type all of this in manual. Absolutely ridiculous!!! So over the weekend I broke out my old HTLM/Javascript books and tried to make a simple webpage/form w/ multiple dropdowns or checkboxes that will hopefully speed up the process. The input dropdowns/checkboxes are at the top of the page w/ a box at the bottom that will post the correct string (including proper brackets,periods,<>,etc).... with a "Generate" and "Reset button in between. I'm using PHP (process.php) to process the data, put it in the correct order and then post it back in the box (treated as a separate page.) The problem I'm having is the the Javascript strips away the < and > (greater/lessthan) symbols no matter what I try. I can't get it to post the data w/ these symbols attached. It just treats is as code and posts only the words.
I haven't tried programming in quite some time... so any and all help is greatly appreciated!!! If there's a simpler/easier method, I'll start from scratch if need be. But preferably I'd like to find a simple fix and be done with this.
Thank you!!
DaFunkyBeats
I've been more of the idea man behind this, whereas my unemployed roommate has gotten off the couch to do most of the coding. He's been stuck on this for over a week now and isn't the type to ask for help. If you see major errors that won't give the required results in the above example then by all means feel free to point out his mistakes. I know this can be done, but he's been dancing around the issue... and without the proper bracket,periods, etc the entire thing is useless. So I'm taking the initiative. Any and all help is appreciated. I'd even be willing to PayPal someone for there time and effort if they could just put this together in a nice little site/desktop app. You can use the site prefix at g mail to if need be. This beta ver is @ bjones.site11.com Thanx again!!!
***********
** INDEX **
***********
xmlns="http://www.w3.org/1999/xhtml">
Untitled Document
Performer:
Gender
N/AMaleFemale
Age
Eyes
N/ABlueBrownGreenHazelBlackGrayRed
Height
N/AShortAverageTall
Hair Color
N/ABlonde FBlond MBrown FBrown MBlackRedSalt/PepperGray
Hair Length
N/AVery ShortShortMediumLongVery Long
Hair Texture
N/AWavyStraightCurly
Bald?
N/ABaldBalding
Ethnicity 1
N/AWhiteBlackHispanicAsian
Ethnicity 2
Skin Tone
N/APale/PastyLight/FairMidtoneTannedDark
Facial Hair
N/ABeardGoatee
Body Nudity
N/AFullPartial
Body View
N/AFrontalRear
Body Hair
N/ATest
Body Type
N/ASlenderAverageToned/AthleticMuscularCurvyObese
Nudity Butt
N/AFullPartial
Butt Area
N/ABottomlessNot Bottomless
Butt Size
N/ALargeSmall
Pubic Hair
N/AHairyTrimmedShaven
Nudity Breasts
N/AFullPartial
Breast Type
N/ARealFake
Breast Size
N/ALargeSmall
Nipples
N/AAreolaPerky
Nudity Penis
N/AFullPartial
Penis Size
N/ASmallLong
Penis Firmness
N/AHardSemi HardSoft
Vagina
Clitteress
Lips
N/ASmallFat
Legs
N/ALongShort
CPSkin
N/AMaleFemale
You need to add all your code in between these tags [ code ] [/ code ] Just to give us an easy time to debug errors in your code.
Cheers,
some special characters are indeed a bit troublesome when handled in web pages, i imagine the same goes for brackets. you could try using the so-called specialchars.
In PHP you could use htmlspecialchars
( http://php.net/manual/en/function.htmlspecialchars.php )
Now, i'm not quite sure wether there's a JScript equivelant, but here is what i would do:
taking a string, then explode it so i get an array with each entry containing exactly one letter.
Then i loop through the array, checking if that one letter matches a letter i call special, and if it is one of those, replace it with a so-called special char.
Dunno if that's the official name, but a special char is set of characters used to represent one special character in HTML. for example, insert & in an HTML page, and it would give an & (ampersand).
A complete list of special characters can be found here:
http://www.utexas.edu/learn/html/spchar.html
I'l make an example loop for you, using an imaginary field called "myField"
$myField = document.getElementByID("myField").value
//might be innerHTML instead of value
expArray = explode("", $myField)
//expArray is now an array, where each entry is exactly one letter long.
for (x = 0;x < count(expArray); x++)
{
switch(expArray[x])
{
case "<":
expArray[x] = "<"
case ">":
expArray[x] = "&rt;"
}
// continue making cases for all the weird symbols, you could also do this using if - else if, else-if etc, but this is quicker and shorter.
}
$myfield = implode($expArray)
//this takes the entire array, and from this point forward you can use it as if it never changedIs this your idea of a joke? Or is it your friend? Or your boss?
if(empty($breastsize)) { $breastsize= $breastsize; } else $breastsize = $breastsize.'.';
if(empty($nuditypenis)) { $nuditypenis= $nuditypenis; } else $nuditypenis = $nuditypenis.'.';
if(empty($penisfirmness)) { $penisfirmness= $penisfirmness; } else $penisfirmness = $penisfirmness.'.';
if(empty($nudityvagina)) { $nudityvagina= $nudityvagina; } else $nudityvagina = $nudityvagina.'.';
if(empty($clitteress)) { $clitteress= $clitteress; } else $clitteress = $clitteress.'.';
Probably not family friendly then. Sounds like a celebrity skin site. No thanks.
@ardav.. Good pick-up on the code. That code just makes me laugh for a bit lol. Surprisingly enough, I didn't bother going through the code line by line because it was NOT readable enough.