I am new to php and I am trying to create a CMS for school project. I am in the data collection phase of a CMS that will run an e-commerce type business. The code below is from a php file that loads after the user selects one of 4 forms from a xhtml page. My plan for this page is to dynamically select the correct form from the xhtml page using "if and “elseif” statements and also validating form entries for each form. Presently when I run the page, I get the following error:
Parse error: syntax error, unexpected T_STRING, expecting ‘,’ or ‘;’ in /home/cdlwebde/public_html/rizzo/collectionsystemrobertizzo.php on line 54
I have looked for hours for any syntax type errors but can’t figure it out. I was wondering if someone could give me some guidance and/or suggestions to fix this. Here is the php page code:
[php]
<?php if(isset($_GET["form"])) { if($_GET["form"]=="productentrysoap") { ?> <?php $soapcatalog = $_POST['soapcatalog']; $soapdescription = $_POST['soapdescription']; $soapprice = $_POST['soapprice']; $soapunits = $_POST['soapunits']; $uploadField = $_POST['uploadField']; $tried=$_POST['tried']=='yes'; if ($tried){ $validated=(!empty($soapcatalog) && !empty($soapdescription) && !empty($soapprice) && !empty($soapunits) && !empty($uploadField)); if (!$validated){ ?>The catalog number, description, price, units and upload fields need to be completed. Please complete to continue.
<?php if ($tried && $validated) { echo 'The item has been created.
; } ?> Soap Product Entry * Catalog:* Soap Description:
Price:
total number of units:
Upload Photo: <?php } elseif ($_GET["form"]=="productentryjewelry"{ ?> <?php $jewelrycatalog = $_POST['jewelrycatalog']; $jewelrydescription = $_POST['jewelrydescription']; $jewelryprice = $_POST['jewelryprice']; $jewelryunits = $_POST['jewelryunits']; $uploadField = $_POST['uploadField']; $tried=$_POST['tried']=='yes'; if ($tried){ $validated=(!empty($jewelrycatalog) && !empty($jewelrydescription) && !empty($jewelryprice) && !empty($jewelryunits) && !empty($uploadField)); if (!$validated){ ?>
The catalog number, description, price, units and upload fields need to be completed. Please complete to continue.
<?php }if ($tried && $validated) {
echo '
The item has been created.
;}
?> Jewelry Product Entry * Catalog:
* Jewelry Description:
Price:
total number of units:
Upload Photo: <?php } elseif ($_GET["form"]=="productentrycraft"{ ?> <?php $craftcatalog = $_POST['craftcatalog']; $craftdescription = $_POST['craftdescription']; $craftprice = $_POST['craftprice']; $craftunits = $_POST['craftunits]; $uploadField = $_POST['uploadField']; $tried=$_POST['tried']=='yes'; if ($tried){ $validated=(!empty($craftcatalog) && !empty($craftdescription) && !empty($craftprice) && !empty($craftunits) && !empty($uploadField)); if (!$validated){ ?>
The catalog number, description, price, units and upload fields need to be completed. Please complete to continue.
<?php }if ($tried && $validated) {
echo '
The item has been created.
;}
?>
Jewelry Product Entry * Catalog:* Jewelry Description:
Price:
total number of units:
Upload Photo: <?php } else ($_GET["form"]=="nickupdates"{ ?> <?php $Nickupdate= $_POST['Nickupdate']; $uploadField = $_POST['uploadField']; $tried=$_POST['tried']=='yes'; if ($tried){ $validated=(!empty($Nickupdate) && !empty($uploadField)); if (!$validated){ ?>
The Nick update field the file upload fields need to be completed. Please complete to continue.
<?php }if ($tried && $validated) {
echo '
The item has been created.
;}
?>
Nick Update: Update:Enter update here
Upload Photo: <?php endif; }
?>
[/php]Thank you for any assistance.