Re: isset

From: Date: Tue, 25 Jun 2002 21:23:51 +0000
Subject: Re: isset
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-14406@lists.php.net to get a copy of this message
You can do if(!isset($_POST['email'])) { go_back(); } else { print "Thanx"; } or if($_POST['email'] == "") { go_back(); } else { print "Thanx"; } "Jan - Cwizo" <cwizo@3delavnica.com> wrote in message news:5.1.0.14.2.20020625181340.00b7b658@mail.zipp.nu... > Hi > > I am a building a guestbook as a course of my learning of PHP. > > I have a page, on wich theree are some input boxes, on th enext page the > data typet in those boxes is putet in to a database. > > I would like to check if there are nay empty input boxes, and if there are > the user would get the sam form back and on the top it would say : Please > fill the empty text boxes, and in the boxes would be the data that he has > puet in. > > And I dount know how to include that in to this code : > > > <? > > include ("../head.php"); > MYSQL_CONNECT("localhost", "user", "password" ) or > die(MYSQL_ERROR() . "napaka1"); > > MYSQL_SELECT_DB("knjiga") or > die(MYSQL_ERROR() . "napaka2"); > > > $ime = strip_tags($_POST[ime]); > $naslov = strip_tags($_POST[naslov]); > $email = strip_tags($_POST[email]); > $url = strip_tags($_POST[url]); > $kom = strip_tags($_POST[kom]); > > > if ($_POST["submit"]) > { > > $query = "insert into knjiga > (ime, naslov, email, url, komentarji) values > > ('$ime','$naslov','$email','$url','$kom')" > ; > > MYSQL_QUERY($query) or > die(MYSQL_ERROR() . "napaka3"); > > > > ?> > > <h2>Thanx</h2> > <h2><a href="poglej.php">Poglej knjigo gostov!</a> > > <? > } > else > { > include("index.php"); > } > ?> > > > Help would be weary helpfull ! > > PS : Sorry for my spelling, English is not my native langugae !! > > > > LP > JaN > www.3delavnica.com >

« previous php.windows (#14406) next »