Skip to main content

mysql row turning into attributes



I need help with an <input> . Some times when I call for the var to be inserted into the value="" part of the <input> it makes every word into an attribute. For example my tag will look like this <input type="hidden" name="article" this="" is="" the="" article="" text="" />





and the call to the <input> is this echo '<input type="hidden" name="article" value="'.$row['article'].'" />';





below is the actual code





CODE:







echo '<input type="hidden" name="date_added" value="'.$row['date_added'].'" />';

echo '<input type="hidden" name="id" value="'.$row['id'].'" />';

echo '<input type="hidden" name="article" value="'.$row['article'].'" />';

echo '<input type="hidden" name="pub_date" value="'.$row['pub_date'].'" />';







OUTPUT:







<input type="hidden" "="" added.="" snow,"="" shoveling="" those="" times,="" four="" years="" two="" real="" worn="" only="" "i've="" balance."="" i'm="" feels,="" actual="" where="" point="" gotten="" i've="" shoes.="" thing,"="" different="" whole="" ground,="" can="" "when="" world."="" senses="" off="" closing="" disconnected.="" time.="" all="" gloves="" wearing="" likens="" feeling."="" addicting="" an="" almost="" it's="" you,="" around="" world="" feeling="" used="" "you="" them,"="" comfortable="" you're="" wear="" choosing="" more="" "it's="" feet.="" your="" feel="" lifestyle"="" "barefoot="" calls="" being="" enjoys="" things="" explained="" experience."="" textures="" many="" "there's="" greatest,"="" "chautauqua="" chautauqua,="" trailhead="" favorite="" group's="" boulder="" aurora="" members="" year-round="" hikes="" day?"="" my="" rest="" what="" well,="" at,="" look="" have="" you="" that,="" explore="" start="" "but="" society,"="" prolific="" because="" thing,="" now="" attention="" people's="" grabbing="" what's="" members,="" 100="" surpassed="" recently="" grown="" has="" their="" it?="" why="" thought,="" hiking,="" enjoyed="" since="" home,="" clients="" works="" she's="" day="" spending="" already="" brushaber="" group.="" join="" first="" who="" practitioner="" movement="" brushaber,="" kriste="" organizing="" partner="" hartman's="" hiking.="" eventually,="" walking="" kept="" marathon,="" run="" change.="" change."="" would="" pain.="" back="" time,="" at="" marathon="" training="" problems.="" other="" few="" splints="" shin="" hartman="" ago,"="" while="" running.="" trying="" after="" started="" group="" meetup="" range="" front="" hartman,="" mary="" thing."="" natural,="" this="" into="" getting="" are="" "people="" he="" (shoes),"="" our="" trail="" appalachian="" guys="" "we="" sashen="" somewhere,"="" some="" top="" them="" me="" showing="" people="" from="" pictures="" testimonials="" get="" walking.="" nearly-barefoot="" for="" footwear="" sandals="" vibram-soled="" light="" makes="" which="" shoes,="" invisible="" founder="" sashen,="" steven="" says="" deal,="" big="" becoming="" minimalist="" boom.="" running="" heels="" on="" popularity="" in="" growing="" shoes="" without="" hiking="" say="" barefooters="" local="" most,="" loftier="" bit="" ascent="" barefoot="" baker's="" said.="" could="" knew="" so="" kilimanjaro,="" than="" harder="" lot="" hell="" "longs="" crazy.="" baker="" but="" crazy."="" quite="" is="" climbing="" everyone="" about="" just="" "i="" said,="" barefoot,="" kili="" climb="" try="" crazy="" it="" thought="" would've="" guides="" whether="" asked="" before.="" that="" like="" request="" a="" made="" ever="" had="" one="" no="" though="" even="" sure,="" paschall="" barefoot.="" attempt="" she'd="" sure="" make="" reach,="" within="" adventures="" boulder's="" owner="" paschall,="" robin="" agent,="" travel="" her="" with="" checked="" year,="" last="" peak="" highest="" africa's="" --="" mountain="" 19,336-foot="" trip="" the="" booked="" she="" when="" boulder.="" of="" baker,="" said="" it,"="" welcoming="" really="" not="" were="" and="" it,="" do="" able="" be="" to="" going="" was="" i="" think="" didn't="" they="" value="When Sonnet Baker showed up at the bottom of Mount Kilimanjaro ready to hike up the mountain barefoot, her guides had doubts. " name="article">







All the others <input> fields work fine. Please tell me what I'm doing wrong.


Comments

  1. Always use htmlspecialchars($string, ENT_QUOTES) when putting data in HTML-attributes:

    echo '<input type="hidden" name="article" value="'.htmlspecialchars($row['article'], ENT_QUOTES).'" />';


    Also, google for XSS-attacks.

    ReplyDelete

Post a Comment

Popular posts from this blog

Slow Android emulator

I have a 2.67 GHz Celeron processor, 1.21 GB of RAM on a x86 Windows XP Professional machine. My understanding is that the Android emulator should start fairly quickly on such a machine, but for me it does not. I have followed all instructions in setting up the IDE, SDKs, JDKs and such and have had some success in staring the emulator quickly but is very particulary. How can I, if possible, fix this problem?

CCNA 1 Final Exam 2011 latest (hot hot hot)

  Hi! I have been posted content of ccna1 final exam (latest and only question.) I will post the answer and insert image on sunday. If you care, please subscribe your email an become a first person have full test content. Subcribe now  Some question  have not content because this question have images content. So that can you wait for me? SUNDAY 1. A user sees the command prompt: Router(config-if)# . What task can be performed at this mode? Reload the device. Perform basic tests. Configure individual interfaces. Configure individual terminal lines. 2. Refer to the exhibit. Host A attempts to establish a TCP/IP session with host C. During this attempt, a frame was captured with the source MAC address 0050.7320.D632 and the destination MAC address 0030.8517.44C4. The packet inside the captured frame has an IP source address 192.168.7.5, and the destination IP address is 192.168.219.24. At which point in the network was this packet captured? leaving host A leaving ATL leaving...