
01-27-2004
|
|
|
Re: Can't Insert Data
On 27-Jan-2004, "entoone" <entoone@pacbell.net> wrote:
> I get no error, I get the same indication that the data went into the
> database as I do on the online system, but when you look at the data that
> was inserted.. it's not there.
>
> I do get the following columns populated with data
> id, pword, dtestart, dteupdate
>
> The information from the form is passed to a php file, which is as
> follows..
> Again this all works while being hosted from my ISP online.
> Thanks in advance for any suggestions.
>
>
> <head>
> <meta HTTP-EQUIV="refresh" content=1;url="recadd.htm">
> </head>
> <?php
> mysql_connect("localhost", "xxx", "xxx") or die("Could not connect
> to database server");
> mysql_select_db("xxx") or die("Could not locate
> database");
>
> /* Check if user allready exists if not them add stuff */
> $query = "SELECT * FROM contacts WHERE hcounty='$hcounty' AND
> first='$first' AND last='$last'";
> $result = mysql_query($query) or die("Failure to get infor from the
> database");
> $count = mysql_num_rows($result);
> if($count == 0)
> {
> /* making stuff ready to insert and insert */
> $pword = md5($pword);
> $comments = substr($comments, 0,525);
> $comments = htmlspecialchars($comments, ENT_QUOTES);
> $query = "INSERT INTO contacts VALUES
> ('','$refcode','$first','$last','$address1','$addr ess2','$city','$state','$z
> ip','$phone','$pager','$mobile','$fax','$email','$ web','$prefmethod','$comnu
> mber','$comexpdte','$commexp','$fees','$travelmax' ,'$digdocs','$lang','$esrv
> ','$lprinter','$ascmember','$comments','$hcounty', '','$pword',NOW(),'')";
> $result = mysql_query($query) or die("Failure to write to database");
> print("<B><U><center><h2>Record Added - Database has been
> updated</h2></center></u></b> ");
> /* */
> } else {
> print("<B><U><center><h2>Duplicate > > Entry Found - Can Not Add
> Listing</h2></center></u></b>");
> }
> /* */
>
> mysql_close();
>
> ?>
Looks like register_globals is off and you need to get your data from
$_POST[]
--
Tom Thackrey
www.creative-light.com
tom (at) creative (dash) light (dot) com
do NOT send email to jamesbutler@willglen.net (it's reserved for spammers)
|