Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 20th, 2005, 12:13 PM   #1
bulio
Hobbyist Programmer
 
bulio's Avatar
 
Join Date: Jul 2004
Location: Location
Posts: 138
Rep Power: 5 bulio is on a distinguished road
Submit help

Hi everyone,

I have a product submit form for my company (coded in html). What I would like to do, is that if someone does not fill out all the required fields to submit the product, a php script would tell them something like:

Sorry, you have not filled in $fieldhere. Please go back and fill it in.

The submit form I have can be found here: www.atgig.com/bulio

This is what I have, but I get a parse error:

<?php
if ( (!empty($location)) && (!empty($Description)) && (!empty($Make)) && (!empty($Model)) && (!empty($Year)) && (!empty($Color)) && (!empty($price)) (!empty($InventoryType)) && (!empty($Serial)) && (!empty($name)) )
{
    echo "The product has been submitted ok.";
}
else
{
    echo "You have left a text box blank, please go back and fill it in.";
}
?>

I get the following error when I try it:

Quote:
Parse error: parse error in C:\Documents and Settings\RMcDougall\Desktop\Website\Test Development\_debug_tmp.php on line 2
bulio is offline   Reply With Quote
Old May 20th, 2005, 1:20 PM   #2
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
You forgot an && between "(!empty($price))" and "(!empty($InventoryType))"

 <?php
 if ( (!empty($location)) && (!empty($Description)) && (!empty($Make)) && (!empty($Model)) && (!empty($Year)) && (!empty($Color)) && (!empty($price)) && (!empty($InventoryType)) && (!empty($Serial)) && (!empty($name)) )
 {
     echo "The product has been submitted ok.";
 }
 else
 {
     echo "You have left a text box blank, please go back and fill it in.";
 }
 ?>
__________________

tempest is offline   Reply With Quote
Old May 20th, 2005, 3:21 PM   #3
bulio
Hobbyist Programmer
 
bulio's Avatar
 
Join Date: Jul 2004
Location: Location
Posts: 138
Rep Power: 5 bulio is on a distinguished road
OK everyone, I got it working! but everytime I try to submit, it says i'm missing a required field.

Code in submit.php:

<?php
if ( (!empty($location)) && (!empty($Description)) && (!empty($Make)) && (!empty($Model)) && (!empty($Year)) && (!empty($Color)) && (!empty($price))&& (!empty($InventoryType)) && (!empty($Serial)) && (!empty($name)) )
{
   echo "The product has been submitted ok.";
}
else
{
   echo "You have left a text box blank, please go back and fill it in.";
}
?>

Also, Here's everything in the form:

http://pastebin.com/287113
bulio is offline   Reply With Quote
Old May 20th, 2005, 4:30 PM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
What do you mean? Does it say "You have left a text box blank, please go back and fill it in."?
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old May 22nd, 2005, 12:22 PM   #5
bulio
Hobbyist Programmer
 
bulio's Avatar
 
Join Date: Jul 2004
Location: Location
Posts: 138
Rep Power: 5 bulio is on a distinguished road
No, It gives me a parse error on line 2. I think it is due to my pc. I will be trying it on another one soon.
bulio is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:59 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC