Artiklan Sphere-logo
Main Article Categories Main artikkeli Kategoriat

Step By Step: Add Image Validation To Your Website Form Step by Step: Lisää kuva validoinnista Web-sivuston muodossa

By Expert Author: David Picella Asiantuntijoiden Tekijä: David Picella
View Summary | Submitted: 2006-08-15 | Word Count: 500 words | Views: 115 view(s) Näytä yhteenvetosivu | Lähetetty: 2006-08-15 | Word Count: 500 sanaa | Luettu: 115 mieltä (s)
David Picella
If you are a do-it-yourself programmer and you want to know how to add image validation to a form on your web site then this is the article for you. Jos olet tee-se-itse-ohjelmoija ja haluat tietää, miten lisätä kuvan validoinnista muodossa Web-sivusto sitten tämä artikkeli sinulle. While there are many ways to do this, if you follow these steps, you will learn the easiest way to get the job done. Vaikka on olemassa monia tapoja tehdä tätä, jos olet tehnyt nämä toimet, näyttöön tulee oppia helpoin tapa saada työtä tehnyt. Once you have mastered the example here, you will have all the concepts and experience you need to incorporate the final product into your form on your website. Kun olet Hallittu esimerkki tästä, te kaikki käsitteet ja kokemusta tarvitaan sisällyttämään lopullisen tuotteen lomakkeen sivustoon.

We will need two files. Tarvitsemme kaksi tiedostoa. The first file will create the validation image and incorporate the image in a validation form. Ensimmäisen tiedoston luo validointi kuvan ja sisällyttämään kuvaa ja validointi muodossa. Here is the step-by-step code for the first file: verify.php Tässä on vaihe-vaiheelta-koodin ensimmäisen tiedoston: verify.php

---BEGINNING OF FILE: VERIFY.PHP--- --- ALUSSA KUVA: VERIFY.PHP---

< ?php <? Php

// Create an image where width=200 pixels and height=40 pixels / / Luo kuva, jos leveys = 200 pikseliä ja korkeus = 40 pikseliä

$val_img = imagecreate(200, 40); $ val_img = imagecreate (200, 40);

// Allocate 2 colors to the image / / Allocate 2 värit kuva

$white = imagecolorallocate($val_img, 255, 255, 255); $ valkoinen = imagecolorallocate ($ val_img, 255, 255, 255);

$black = imagecolorallocate($val_img, 0, 0, 0); $ musta = imagecolorallocate ($ val_img, 0, 0, 0);

// Create a seed to generate a random number / / Luo siemen tuottaa satunnaisluvun

srand((double)microtime()*1000000); srand ((Double) microtime () * 1000000);

// Run the random number seed through the MD5 function / / Suorita satunnaisluku siementen kautta MD5-toiminto

$seed_string = md5(rand(0,9999)); $ seed_string = md5 (randia (0,9999));

// Chop the random string down to 5 characters / / Chop satunnainen merkkijono alas 5 merkkiä

// This is the validation code we will use / / Tämä on validoida koodi aiomme käyttää

$val_string = substr($seed_string, 17, 5); $ val_string = substr ($ seed_string, 17, 5);

// Set the background of the image to black / / Aseta tausta kuvan musta

imagefill($val_img, 0, 0, $black); imagefill ($ val_img, 0, 0, $ musta);

// Print the validation code on the image in white / / Tulosta validointi koodi kuvan valkoinen

imagestring($val_img, 4, 96, 19, $val_string, $white); imagestring ($ val_img, 4, 96, 19, $ val_string, $ valkoinen);

// Write the image file to the current directory / / Kirjoita kuvan tiedosto nykyisen hakemiston

imagejpeg($val_img, "verify.jpg"); imagejpeg ($ val_img "verify.jpg");

imagedestroy($val_img); imagedestroy ($ val_img);

? >

< !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <! DOCTYPE HTML PUBLIC "- / / W3C / / DTD HTML 4.01 Transitional / / EN"

"http://www.w3.org/TR/html4/loose.dtd" > "http://www.w3.org/TR/html4/loose.dtd">

< html > <Html>

< head > <Head>

< meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" > <Meta http-equiv = "Content-Type" content = "text / html; charset = iso-8859-1">

< title >Image Verification< /title > <Title> Kuva vahvistus </ title>

< /head > </ Head>

< body > <Body>

< img src="verify.jpg" height="40" width="200" alt="validation image" / > <Img src = "verify.jpg" height = "40" width = "200" alt = "validointi kuva" />

< br / >< br / >Type in the validation code from the image. <Br /> <br /> Kirjoita validointi koodi kuvaa. (case sensitive) (erottele)

< form action="validateform.php" method="post" > <Form action = "validateform.php" method = "post">

< input name="random" type="text" value="" > <Input name = "satunnaisen" type = "text" arvo = "">

< input type="submit" > <Input type = "submit">

< !-- The validation code will be posted from a hidden form element -- > <! - Validointi koodi on lähetetty on piilotettu muodossa elementti ->

< input name="validation" type="hidden" value="< ?php echo $val_string ? >" > <Input name = "validointi" type = "piilotettu" value = "<? Php echo $ val_string?>">

< /form > </ Form>

< /body > </ Body>

< /html > </ Html>

---END OF FILE: VERIFY.PHP--- --- END OF FILE: VERIFY.PHP---

Now we will create a file that will perform the validation using the POST method: Nyt luo tiedoston, joka suorittaa validointi käyttäen POST-menetelmää:

---BEGINNING OF FILE: VALIDATEFORM.PHP--- --- ALUSSA KUVA: VALIDATEFORM.PHP---

< ?php <? Php

if ($_POST['validation'] == trim($_POST['random'])){ if ($ _POST [ 'vahvistus'] == TRIM ($ _POST [' satunnainen'])){

echo "You are validated"; echo "Sinulla on validoitu";

} )

else{ else (

echo "Please go back and get validated."; echo "Ole hyvä ja mene takaisin ja saada validoitu."

} )

? >

---END OF FILE: VALIDATEFORM.PHP--- --- END OF FILE: VALIDATEFORM.PHP---

IMPORTANT NOTE: Because many free article websites don't support HTML in the body of the article the files above won't work unless you eliminate the space after < and before >. TÄRKEÄ HUOMAUTUS: Koska monet vapaa artikkeli Web-sivustot eivät tue HTML itse artikkelin tiedostot edellä ei toimi, ellet poistaa tila <ja ennen>. Just do a find and replace all. Tee etsiä ja korvata kaikki.

That is really all there is to it. Tämä on oikeastaan kaikki on sitä. You probably noticed that I also went to the trouble of including the DOCTYPE and charset lines in this simple example. Olet luultavasti huomannut, että olen myös meni vaivaa muun muassa DOCTYPE ja charset rivit tämän yksinkertaisen esimerkin. I did this as a little reminder to make sure that all of your pages on your website are W3C compliant. Tein tämän pienen muistutuksen varmista, että kaikki sivujesi sivuston W3C-yhteensopiva. One of the biggest mistakes that many webmasters make is to neglect W3C compliance on their web pages. Yksi suurimmista virheistä, että monet ylläpitäjät tehdä on laiminlyödä W3C noudattaminen niiden www-sivuja. If your web pages are not W3C compliant you will get low search engine rankings. Jos Web-sivut eivät ole W3C-yhteensopiva saat alhainen hakukone maailman rankingissa. Even worse, if you are advertising, your ads may not be as relevant as they should be! Vielä pahempaa, jos olet mainontaa, mainoksesi ei ehkä ole niin merkitystä, koska niiden pitäisi olla! In my other article, I explain W3C compliance and the most common mistakes. Minun muita tarvikkeita, selitän W3C noudattamista ja yleisimmät virheet.

Copyright 2006 David Picella Copyright 2006 David Picella

About the Author/Author Bio Tietoa Tekijä / Tekijät Bio

Original article and source code for download are available at http://picella.com -- The author, David Picella, is a PhD Student at the University of Wisconsin Milwaukee. Alkuperäinen artikkeli ja lähdekoodia latauksia on saatavilla http://picella.com - Kirjailija, David Picella on PhD Student yliopiston Wisconsin Milwaukee. In addition to his technical articles on technology and Internet subjects, he has written other articles on health care topics in women's health and reproductive care. Lisäksi hänen teknisiä artikkeleita teknologia-ja Internet-aiheita, hän on kirjoittanut muiden artikkeleita terveydenhuollon aiheista naisten terveyden-ja lisääntymisterveyden hoitoa.

Article Source: http://www.articlesphere.com/Article/Step-By-Step--Add-Image-Validation-To-Your-Website-Form/45979 Artiklan Lähde: http://www.articlesphere.com/Article/Step-By-Step--Add-Image-Validation-To-Your-Website-Form/45979

This article has been viewed 115 time(s). Tämä artikkeli on katsottu 115 kertaa (s).

More "Web Development" Related Articles Lisää "Web development" liittyviä artikkeleita

Listed below are more articles related to the above article from the "Web Development" article category. Alla lueteltujen ovat artikkeleita, jotka liittyvät edellä artikkeli "Web Development" artikkelin luokkaan.

People interested in the above article "Step By Step: Add Image Validation To Your Website Form" are also interested in the related articles listed below: Ihmiset ovat kiinnostuneita edellä artikkeli "Step by Step: Lisää kuva Validation sivustoosi muoto" kiinnostaa myös siihen liittyvät artikkelit on lueteltu alla:

The web market is booming at a high rate. Web-markkinat ovat elpymässä on korkea. The need for quality web services has also grown over the years. Tarve laadun web-palveluita on myös kasvanut viime vuosina. The market is ripe for the talented professionals to make a new move. Markkinat ovat kypsät, että lahjakkaita ammattilaisia tekemään uuden liikkua. Many people are joining web programming companies and earning huge benefits. Monet ihmiset ovat liittymässä Web-ohjelmointi-ja ansaitsee valtavia etuja.
Your business website is your corporate identity on the web. Yrityksesi Internet-sivuilla on yrityksen identiteetti Webissä. It accomplishes a number of objectives in one go. Se accomplishes useita tavoitteita yhdessä mennä. It acts as your storefront, your online office and your reception. Se toimii kuin oma myymälä, online-toimisto ja vastaanotto. It is the point of contact between you and your visitors. Se on yhteyspiste, ja teidän kävijöitä. Your website is the personification of your business, your brand and the quality of your product or service. Web-sivustosi on henkilöitymä yrityksesi, tuotemerkkiin ja sen laadun tuotteen tai palvelun. Therefore, your business website had better be topnotch if you want people to take you and your business seriously. Siksi yrityksesi Internet-sivuilla oli parempi olla huippu, jos haluamme, että ihmiset ottaa sinun ja yrityksesi vakavasti.
The Internet is a constantly evolving world, frequently redefining it limits and capabilities. Internet on jatkuvasti kehittyvää maailmaa, usein uudelleen sen rajat ja valmiuksia. This, of course, poses a challenge for any business or organization that wants to keep its web presence up-to-date. Tämä tietysti on haaste mille tahansa yrityksen tai organisaation, joka haluaa pitää sen verkossa ajan tasalla. The days of flat sites are long gone—a page of text, pictures, and links will simply miss the mark. Päivinä tasainen sivustot ovat pitkään poissa-sivun tekstiä, kuvia ja linkkejä vain unohda markkaa. Today, a web site must be able to work. Tänään, Web-sivuston on työkykyinen. Users have come to expect a web site to carry numerous functionalities and features. Käyttäjät ovat tottuneet odottamaan verkkosivuston kuljettaa useita toimintoja ja ominaisuuksia. This is where the field of Web Development comes in: Web Development deals with the intricate programming that fashions a website into an intricate, working tool. Tämä on alalla Web Development tulee: Web Development koskee mutkikasta ohjelmaa, muodista verkkosivuilla osaksi monivaiheinen, työväline.
Have you ever wished your website had a forum, a blog, a photo galley, or maybe even a shopping cart? Oletko koskaan halunnut sivustosi ollut foorumi, blogi, valokuva keittiöissä, tai ehkä jopa ostoskoria? And you were so excited to get that all set up until you realized you had no idea how to do it and quickly became so frustrated trying to find an easy solution you just gave up? Ja sinulla oli niin innoissaan saada kaikki perustaa, ennen kuin olet ymmärtänyt sinulla ei ollut aavistustakaan, miten se tehdään nopeasti ja tuli niin turhautunut yrittää löytää sopivaa ratkaisua, jota juuri luopui? What if all you had to do was click one button? Mitä jos kaikki mitä oli tehtävä oli klikkaamalla painiketta?
After hours of loving design and careful tweaking of your pages, and valuable time spent online painstakingly submitting your URL to every search engine you can find, you want results. Kun tunnin rakastava suunnittelua ja huolellista säätämistä sivusi, ja arvokasta aikaa viettänyt online vaivalla lähetät URL-osoite, joka hakukoneen avulla voit etsiä, haluatko tulokset. And, more importantly, you need to know what your visitors think of your site, so you can plan any changes or upgrades. Ja mikä tärkeintä, sinun täytyy tietää, mitä kävijät ajatella sivustoosi, jotta voit suunnitella muutoksia tai päivityksiä.
I really think it’s time we got rid of the World Wide Web. Olen todellakin sitä mieltä, että aika me pääsimme eroon World Wide Web. It’s too big, too clumsy, and too bad at doing the things we want to do with it. Se on liian iso, liian kömpelö ja liian huonoja tekee asioita, joita emme halua tehdä sitä. The World Wide Web, in my opinion, is a waste of the Internet’s potential. World Wide Web, on mielestäni tuhlausta Internetin mahdollisuuksia. For many people the Web is the Internet and even those old enough and sufficiently wire headed to remember the pre-Mosaic days would tend to argue that it’s so much more accessible and user friendly than those technologies which preceded it. Monille ihmisille Web on Internetissä ja myös niitä tarpeeksi vanha ja riittävän lanka otsikko on muistettava ennen Mosaic päivää olisi tapana väittää, että se on niin paljon helpommin ja käyttäjäystävällinen kuin teknologiaa, joka edelsi sitä.
The story of the Internet is rather different. Tarina Internet on melko erilainen. It didn’t start with a patented and aggressively marketed product from Bell, Marconi or IBM. Alussa ei ollut patentoitu ja aggressiivisesti kaupan tuote Bell, Marconi tai IBM. In fact, it’s hardly overstating matters to say that the Internet pretty much happened by accident. Itse asiassa, se tuskin liioittele asioita sanoa, että Internet melko paljon tapahtunut onnettomuus. It ‘just growed’, and managed to do so without any serious involvement from the commercial world. Se vain growed ", ja onnistui tekemään niin ilman vakavia osallistumista kaupallisen maailman.
Article Directory Home Artiklan Hakemiston kotisivu Internet And E-Business Internet-ja E-Business Web Development Web Development PA PA

Can't find what you're looking for? Ei löydä mitä etsit? Try Google Search! Kokeile Google-hakua!
(Search in 23 languages: English, Spanish, Japanese, Arabic, Italian, German, (Hae 23 kielellä: Englanti, espanja, japani, arabia, italia, saksa,
Chinese Simplified, Chinese Traditional, Dutch, Korean, Portuguese, Russian, Greek, Kiina yksinkertaistettu, kiina perinteinen, hollanti, korea, portugali, venäjä, kreikka,
Swedish, Romanian, Polish, Norwegian, Finnish, Danish, Czech, Croatian, Bulgarian) Ruotsi, romania, puola, Norja, suomi, tanska, tšekki, kroaatti, bulgaria)
Copyright © 2005 - Copyright © 2005 -- by Larry Lim , Singapore - Article Search Engine Directory at ArticleSphere.com™ käyttäjän Larry Lim, Singapore - Artikkeli Search Engine Directory klo ArticleSphere.com ™
All Rights Reserved Worldwide. Kaikki oikeudet pidätetään maailmanlaajuisesti. All Trademarks and Servicemarks are the property of the respective owners. Kaikki tavaramerkit ja Servicemarks ovat omaisuutta, jotka ovat omistajiensa tavaramerkkejä.
Template Design by Internet Marketing Singapore | Internet Marketing Template design by Internet-markkinointi Singapore | Internet-markkinointi
Français Español 日本語 [أربيك] Italiano Deutsch 汉语 漢語 Nederlands 한국어 PortРусско
Ελληνικά Swedish Indo Romanian Polish Norwegian Hindi Finnish Danish Czech Croatian Bulgarian English - Original language