Forums

Parse error

marky_mark 17 Apr, 2009
Parse error: syntax error, unexpected T_VAR, expecting ',' or ';' in /home/content/l/o/a/loadbroker/html/truckalocity/components/com_chronocontact/chronocontact.php(45) : eval()'d code on line 12

I'm getting this error from website address "truckalocity.com/component/option,com_chronocontact/chronoformname,truckalocity_form2/lang,en"

Then after filling out the form I'm getting these error

Parse error: syntax error, unexpected T_VAR, expecting ',' or ';' in /home/content/l/o/a/loadbroker/html/truckalocity/components/com_chronocontact/chronocontact.php(45) : eval()'d code on line 12

Fatal error: Call to a member function bind() on a non-object in /home/content/l/o/a/loadbroker/html/truckalocity/components/com_chronocontact/libraries/customcode.php(59) : eval()'d code on line


this is my code for
chronocontact.php

<?php
/**
 * CHRONOFORMS version 3.1
 * Copyright (c) 2006 Chrono_Man, ChronoEngine.com. All rights reserved.
 * Author: Chrono_Man (ChronoEngine.com)
 * See readme.html.
 * Visit http://www.ChronoEngine.com for regular update and information.
 **/

/* ensure that this file is called by another file */
defined('_JEXEC') or die('Restricted access');

/**
 * Load the HTML class
 */
require_once( JApplicationHelper::getPath( 'front_html' ) );
require_once( JApplicationHelper::getPath( 'class' ) );

require_once ( JPATH_BASE .DS.'includes'.DS.'defines.php' );
require_once ( JPATH_BASE .DS.'includes'.DS.'framework.php' );
$mainframe =& JFactory::getApplication('site');
$mainframe->initialise();
//load chronoforms classes
require_once( JPATH_COMPONENT.DS.'libraries'.DS.'chronoform.php');
require_once( JPATH_COMPONENT.DS.'libraries'.DS.'mails.php');
require_once( JPATH_COMPONENT.DS.'libraries'.DS.'customcode.php');
require_once( JPATH_COMPONENT.DS.'libraries'.DS.'chronoformuploads.php');
require_once( JPATH_COMPONENT.DS.'libraries'.DS.'plugins.php');




jimport( 'joomla.application.component.controller' );
global $mainframe;
$CFDBO =& JFactory::getDBO();
$formname = JRequest::getVar( 'chronoformname');
if ( !$formname ) {
	$params =& $mainframe->getPageParameters('com_chronocontact');
	$formname = $params->get('formname');
}

$MyForm =& CFChronoForm::getInstance($formname);

if($MyForm->formparams->dbconnection == "Yes"){
	eval ("?>".$MyForm->formrow->dbclasses);
}

$posted = JRequest::get( 'post' , JREQUEST_ALLOWRAW );
/**
 * Main switch statement
 */
switch( $task ) {
	case 'send':
		uploadandmail();
		break;
	case 'extra':
		doextratask();
		break;
	default:
		showform($posted);
		break;
}
/**
 * End of main page
 *
 */

/**
 * Display the form for entry
 *
 */
function showform($posted)
{
    global $mainframe;
	$database =& JFactory::getDBO();

    $formname = JRequest::getVar( 'chronoformname');
	if ( !$formname ) {
		$params =& $mainframe->getPageParameters('com_chronocontact');
		$formname = $params->get('formname');
	}
    $MyForm =& CFChronoForm::getInstance($formname);
	$MyForm->showForm($formname, $posted);
    //HTML_ChronoContact::showform( $MyForm->formrow, $posted);
}

/**
 * Respond to a submitted form
 *
 */
function uploadandmail()
{
    global $mainframe;
	$database =& JFactory::getDBO();
	$posted = JRequest::get( 'post' , JREQUEST_ALLOWRAW );
	
	// Block SPAM through the submit URL
	if(!JRequest::checkToken()){
		echo "You are not allowed to access this URL";
		return;
	}
	if ( empty($posted) ) {
		echo "You are not allowed to access this URL directly, POST array is empty";
		return;
	}

	//Load Chronoforms Classes
	$MyForm =& CFChronoForm::getInstance();
	$MyFormData = $MyForm->getForm(JRequest::getVar( 'chronoformname'));
	if($MyFormData){
		//fine
	}else{
		$mainframe->enqueueMessage('Error processing this form, form was not loaded!');
		return;
	}
	$MyForm->submitForm($MyForm->formrow->name);
}

function doextratask(){
	global $mainframe;
	$database =& JFactory::getDBO();
	$posted = JRequest::get( 'post' , JREQUEST_ALLOWRAW );
	$formname = JRequest::getVar( 'chronoformname');
	if ( !$formname ) {
		$params =& $mainframe->getPageParameters('com_chronocontact');
		$formname = $params->get('formname');
	}
    $MyForm =& CFChronoForm::getInstance($formname);
	$extraid = JRequest::getVar( 'extraid');
	$MyForm->doExtra($formname, $extraid, $posted);
}
?> 



Here is my HTML

<table width="733" border="0" align="center">
    <tr>
      <td><span class="style1">RATE CONFIRMATION -  FROM</span></td>
      <td><strong>Load Number ___________________________<br />
      </strong></td>
    </tr>
  </table>
  <p align="center">Don @ AvailableTrucking.com   800 555 2222<br />
Agent for Truckalocity</p>
  <p>
  <label></label>
  <br />
    TO:
  <label>
  <input type="text" name="To" id="To" />
  </label>
    dispatcher FOR Motor Carrier
  <label>
  <input type="text" name="dispatcher_FOR_Carrier" id="dispatcher_FOR_Carrier" />
  </label>
  <br />
    MC
  <label>
  <input name="MC#" type="text" id="MC#" size="8" maxlength="10" />
  </label>
    Phone
  <label>
  <input name="phone" type="text" id="phone" size="15" maxlength="15" />
  </label>
    FAX
  <label>
  <input name="fax" type="text" id="fax" size="15" maxlength="15" />
  </label>
  <br />
  <br />
    KNOW THIS: YOU DISPATCH YOUR OWN DRIVER ! YOU ARE RESPONSIBLE FOR YOUR APPOINTMENTS<br />
    CALL NOW !  AVOID DELAYS       IN LOADING AND UNLOADING<br />
  <br />
    Pick @CONSIGNOR/SHIPPER Day
  <label>
  <select name="consignor_day" id="consignor_day">
    <option selected="selected">Monday</option>
    <option>Tuesday</option>
    <option>Wednesday</option>
    <option>Thursday</option>
    <option>Friday</option>
    <option>Saturday</option>
    <option>Sunday</option>
  </select>
  </label>
    Date
  <label>
  <input name="consignor_date" type="text" id="consignor_date" size="10" maxlength="10" />
  </label>
    Call NOW for Appt<br />
    Name
  <label>
  <input name="consignor_name" type="text" id="consignor_name" size="40" maxlength="40" />
  </label>
    Pick #
  <label>
  <input name="consignor_pick#" type="text" id="consignor_pick#" size="15" maxlength="15" />
  </label>
  <br />
    Address
  <label>
  <input name="consignor_address" type="text" id="consignor_address" size="50" maxlength="50" />
  </label>
  <br />
    City
  <label>
  <input name="consignor_city" type="text" id="consignor_city" size="20" maxlength="20" />
  </label>
    St
  <label>
  <input name="consignor_state" type="text" id="consignor_state" size="4" maxlength="4" /> 
    Zip 
  <input name="consignor_zip" type="text" id="consignor_zip" size="8" maxlength="8" />
  </label>
  <br />
    Phone                                                                         Contact
  <label>
  <input name="consignor_phone" type="text" id="consignor_phone" size="12" maxlength="12" />
  </label>
    @ ext 
  <label>
  <input name="consignor_ext" type="text" id="consignor_ext" size="5" maxlength="5" />
  </label>
  <br />
  </p>
  <p>Pick @CONSIGNEE Day
    <label>
    <select name="consignee_day2" id="consignee_day2">
      <option selected="selected">Monday</option>
      <option>Tuesday</option>
      <option>Wednesday</option>
      <option>Thursday</option>
      <option>Friday</option>
      <option>Saturday</option>
      <option>Sunday</option>
    </select>
    </label>
Date
<label>
<input name="consignee_date2" type="text" id="consignee_date2" size="10" maxlength="10" />
</label>
Call NOW for Appt<br />
Name
<label>
<input name="consignee_name2" type="text" id="consignee_name2" size="40" maxlength="40" />
</label>
Pick #
<label>
<input name="consignee_pick#2" type="text" id="consignee_pick#2" size="15" maxlength="15" />
</label>
<br />
Address
<label>
<input name="consignee_address2" type="text" id="consignee_address2" size="50" maxlength="50" />
</label>
<br />
City
<label>
<input name="consignee_city2" type="text" id="consignee_city2" size="20" maxlength="20" />
</label>
St
<label>
<input name="consignee_state2" type="text" id="consignee_state2" size="4" maxlength="4" />
Zip
<input name="consignee_zip2" type="text" id="consignee_zip2" size="8" maxlength="8" />
</label>
<br />
Phone                                                                         Contact
<label>
<input name="consignee_phone2" type="text" id="consignee_phone2" size="12" maxlength="12" />
</label>
@ ext
<label>
<input name="consignor_ext2" type="text" id="consignor_ext2" size="5" maxlength="5" />
</label>
<br />
<br />
  <br />
    Load Description 
    <label>
    <input name="load_description" type="text" id="load_description" size="35" maxlength="35" />
    </label>
    product 
    <label>
    <input name="product" type="text" id="product" size="15" maxlength="15" />
    </label>
    <br />
    EQUIP Type 
    <label>
    <input name="equip_type" type="text" id="equip_type" size="15" maxlength="15" />
    </label>
    <br />
    SPECIAL INSTRUCTION 
    <label>
    <input name="special_instruction" type="text" id="special_instruction" size="80" maxlength="80" />
    </label>
    <br />
    # 
    <label>
    <input name="number_pallets" type="text" id="number_pallets" size="5" maxlength="5" />
    </label>
    Pallets pieces 
    <label>
    <input name="palllet_pieces" type="text" id="palllet_pieces" size="6" maxlength="6" />
    </label>                                      
    Weight 
    <label>
    <input name="weight" type="text" id="weight" size="6" maxlength="6" />
    </label>
    lbs<br />
  <br />
    Declared value if any                                                                               degrees kept if reefer                                              pallet exch    y       n<br />
  <br />
    EXTRA pick/stop            STOP                                 STOP                                          STOP<br />
  </p>
  <table width="807" border="0">
    <tr>
      <th scope="row">Name</th>
      <td><label>
        <input name="extra_stop_name1" type="text" id="extra_stop_name1" size="30" maxlength="30" />
      </label></td>
      <td><label>
        <input name="extra_stop_name2" type="text" id="extra_stop_name2" size="30" maxlength="30" />
      </label></td>
      <td><label>
        <input name="extra_stop_name3" type="text" id="extra_stop_name3" size="30" maxlength="30" />
      </label></td>
    </tr>
    <tr>
      <th scope="row">Address</th>
      <td><label>
        <textarea name="extra_stop_address1" cols="35" rows="2" id="extra_stop_address1"></textarea>
      </label></td>
      <td><textarea name="extra_stop_address2" cols="35" rows="2" id="extra_stop_address2"></textarea></td>
      <td><textarea name="extra_stop_address3" cols="35" rows="2" id="extra_stop_address3"></textarea></td>
    </tr>
    <tr>
      <th scope="row">Contact</th>
      <td><input name="extra_stop_contact1" type="text" id="extra_stop_contact1" size="30" maxlength="30" /></td>
      <td><input name="extra_stop_contact2" type="text" id="extra_stop_contact2" size="30" maxlength="30" /></td>
      <td><input name="extra_stop_contact3" type="text" id="extra_stop_contact3" size="30" maxlength="30" /></td>
    </tr>
    <tr>
      <th scope="row">Phone#</th>
      <td><input name="extra_stop_phone1" type="text" id="extra_stop_phone1" size="30" maxlength="30" /></td>
      <td><input name="extra_stop_phone2" type="text" id="extra_stop_phone2" size="30" maxlength="30" /></td>
      <td><input name="extra_stop_phone3" type="text" id="extra_stop_phone3" size="30" maxlength="30" /></td>
    </tr>
  </table>
  <p><br />
    MOTOR CARRIER PAY $
      <label>
    <input name="motor_carrier_pay" type="text" id="motor_carrier_pay" size="6" maxlength="6" />
    </label>
    + fsc 
    <label>
    <input name="fsc" type="text" id="fsc" size="6" maxlength="6" />
    </label>
    + Other 
    <label>
    <input name="other_pay" type="text" id="other_pay" size="6" maxlength="6" />
    </label>
    TOTAL $
    <label>
    <input name="totla_carrier_pay" type="text" id="totla_carrier_pay" size="7" maxlength="7" />
    </label>
  ALL INCLUSIVE<br />
  <label>
  <input type="submit" name="Submit" id="Submit" value="Submit" />
  </label>
  </p>
  <p align="center"><br />
    After Delivery: SEND REQUIRED PAPER WORK eg.  POD, SCALE TICKETS, and THIS SIGNED RATE CONFIRMATION along with your  FREIGHT INVOICE -  TO:<br />
    <br />
    Truckalocity.com                          Billing Inquiry, call Michelle<br />
    PO BOX 161                                                               623 332 2232<br />
    YOUNGTOWN, AZ  85363 0296                                                   FAX  623 974 9748<br />
      </p>

If any one can help please jump in.

Mark
GreyHead 17 Apr, 2009
Hi marky_mark,

The failure is in the db code section - looking at the html I think the culprit is probably name="consignee_pick#2" Try it without the # please (you may have to rename the table column).

Bob
marky_mark 19 Apr, 2009
thanks I'll give that a try

Mark
This topic is locked and no more replies can be posted.