Re: Re: New set of eyes?

From: Date: Wed, 19 Jun 2002 18:45:27 +0000
Subject: Re: Re: New set of eyes?
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-19885@lists.php.net to get a copy of this message
Make sure you don't have any single-quotes in your forms or you'll blow out the SQL statement. Do a var_dump($query) and paste it into the command line processor. -Mike ----- Original Message ----- From: "Jas" <jlgerfen@hotmail.com> To: <php-db@lists.php.net> Sent: Wednesday, June 19, 2002 9:38 AM Subject: [PHP-DB] Re: New set of eyes? > I think a better question would be, how can i get the error message on an > sql function? > Jas > > "Jas" <jlgerfen@hotmail.com> wrote in message > news:20020619162855.83577.qmail@pb1.pair.com... > > I think I am over looking something here... If someone could look over > this > > snippit and tell me what I am doing wrong, it would be a great help! > Thanks > > in advance, > > Jas > > <?php > > /* Combine checkboxes into one variable */ > > $site = $yes + $no; > > /* Check for missing form elements */ > > if (!$fname || !$lname || !$addy || !$city || !$st || !$zip || !$aphone || > > !$phone || !$email || !$inquire || !$refer || !$package || !$comments) { > > header ("Location: contact.php"); > > exit; > > } else { > > /* Format the Date and Time */ > > $hour = (date("H")); > > $day = (date("d")); > > $date = (date("F $day, Y")); > > /* Check for client IP address if behind proxy or firewall */ > > if (getenv(HTTP_X_FORWARDED_FOR)) { > > $ipaddy = getenv(HTTP_X_FORWARDED_FOR); > > } else { > > $ipaddy = getenv(REMOTE_ADDR); } > > /* Start and register session variables */ > > session_start(); > > session_register('$ipaddy'); > > /* Connect to database and insert bid */ > > require '/path/to/database/connection/script/db.php'; > > $db_table = "demo_contact"; > > $sql = @mysql_query("INSERT INTO $db_table > > > (fname,lname,addy,city,st,zip,aphone,phone,email,inquire,refer,site,package, > > comments,ipaddy,date) VALUES > > > > ('$fname','$lname','$addy','$city','$st','$zip','$aphone','$phone','$email', > > > > '$inquire','$refer','$site','$package','$comments','$ipaddy','$date')") > > or > > die("Nothing is working today, just give up and start flipping burgers!"); > > // this is where my errors are > > /* Email confirmation to client & webmaster */ > > mail("$email", "Thanks for your request!", "Dear $fname > > $lname,\n\nThank > you > > for using our online demo application, we are certain that we can save you > > alot of time and energy with our customized content management > application. > > A sales representative will be contacting you shortly in regards to your > bid > > request.", "From: email@email.com"); > > mail("email@email.com", "Web Design Bid", "Name: > > $fname$lname\nAddress: > > $addy\nCity: $city\nState: $st\nZip Code: $zip\nPhone: > > ($aphone)$phone\nEmail: $email\nInquiring about: $inquire\nRefered from: > > $refer\nExisting Site: $site\nWeb Package: $package\nComments: > $comments\nIP > > Address: $ipaddy\nDate: $date\n"); } > > ?> > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#19885) next »