Jump to content

Recommended Posts

Hi Guys

 

I am getting the following errr in my code : Parse error: parse error in C:\Program Files\EasyPHP 3.0\www\CleverWebsiteDesigns\modules\mod_contactus\tmpl\default.php on line 61.

 

Please could someone tell me what to change?

 

<?php

 

// no direct access

defined('_JEXEC') or die('Restricted access');

 

if($contact[0] == false) {

echo $contact[1];

} else {

$document =& JFactory::getDocument();

$document->addCustomTag( '<script type="text/javascript" src="'.JURI::base().'media/system/js/validate.js"></script>' );

?>

<script type="text/javascript">

<!--

function validateFormMod( frm ) {

var valid = document.formvalidator.isValid(frm);

if (valid == false) {

// do field validation

if (frm.email.invalid) {

alert( "<?php echo JText::_( 'Please enter a valid e-mail address.', true );?>" );

} else if (frm.text.invalid) {

alert( "<?php echo JText::_( 'CONTACT_FORM_NC', true ); ?>" );

}

return false;

} else {

frm.submit();

}

}

// -->

</script>

<form action="<?php echo JRoute::_( 'index.php' );?>" method="post" name="emailForm2" id="emailForm2" class="form-validate">

<div class="contact_email">

<label for="contact_name">

 <?php echo JText::_( 'Enter your name' );?>:

</label><label id="contact_emailmsg" for="contact_email">

 <?php echo JText::_( 'Email address' );?>:

</label><br />

<input type="text" name="name" id="contact_name" size="12" class="inputbox" value="" />

<input type="text" id="contact_email" name="email" size="12" value="" class="inputbox required validate-email" maxlength="100" /><br />

<label for="contact_subject">

 <?php echo JText::_( 'Message subject' );?>:

</label>

<br />

<input type="text" name="subject" id="contact_subject" size="30" class="inputbox" value="" /><br />

<label id="contact_textmsg" for="contact_text">

 <?php echo JText::_( 'Enter your message' );?>:

</label>

<br />

<div style="float:left;"><textarea style="height:50px; width:150px; overflow:auto;" cols="16" rows="2" name="text" id="contact_text" class="inputbox required"></textarea></div>

<div style="float:left; margin-left:5px;">

<input type="image" src="<?php echo JURI::base(); ?>modules/mod_contactus/send.png" onclick="validateFormMod(this.form); return false;" />

</div>

</div>

<div style="clear:both;"></div>

 

<input type="hidden" name="option" value="com_contact" />

<input type="hidden" name="view" value="contact" />

<input type="hidden" name="id" value="<?php echo $contact[1]; ?>" />

<input type="hidden" name="task" value="submit" />

<?php echo JHTML::_( 'form.token' ); ?>

</form>

{<? };

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/171940-parse-error/
Share on other sites

My apologies, Line 61 is the last line of code but I read online that if its saying the last line of code is the problem it could actually be anywhere in the code.

 

Not 100% sure very new to this, hacing a problem with a joomla module.

 

<?php

// no direct access
defined('_JEXEC') or die('Restricted access');

if($contact[0] == false) {
echo $contact[1];
} else {
$document =& JFactory::getDocument();
$document->addCustomTag( '<script type="text/javascript" src="'.JURI::base().'media/system/js/validate.js"></script>' );
?>
<script type="text/javascript">
<!--
	function validateFormMod( frm ) {
		var valid = document.formvalidator.isValid(frm);
		if (valid == false) {
			// do field validation
			if (frm.email.invalid) {
				alert( "<?php echo JText::_( 'Please enter a valid e-mail address.', true );?>" );
			} else if (frm.text.invalid) {
				alert( "<?php echo JText::_( 'CONTACT_FORM_NC', true ); ?>" );
			}
			return false;
		} else {
			frm.submit();
		}
	}
// -->
</script>
<form action="<?php echo JRoute::_( 'index.php' );?>" method="post" name="emailForm2" id="emailForm2" class="form-validate">
	<div class="contact_email">
		<label for="contact_name">
			 <?php echo JText::_( 'Enter your name' );?>:
		</label><label id="contact_emailmsg" for="contact_email">
			 <?php echo JText::_( 'Email address' );?>:
		</label><br />
		<input type="text" name="name" id="contact_name" size="12" class="inputbox" value="" />	
		<input type="text" id="contact_email" name="email" size="12" value="" class="inputbox required validate-email" maxlength="100" /><br />
		<label for="contact_subject">
			 <?php echo JText::_( 'Message subject' );?>:
		</label>
		<br />
		<input type="text" name="subject" id="contact_subject" size="30" class="inputbox" value="" /><br />
		<label id="contact_textmsg" for="contact_text">
			 <?php echo JText::_( 'Enter your message' );?>:
		</label>
		<br />
		<div style="float:left;"><textarea style="height:50px; width:150px; overflow:auto;" cols="16" rows="2" name="text" id="contact_text" class="inputbox required"></textarea></div>
		<div style="float:left; margin-left:5px;">
		<input type="image" src="<?php echo JURI::base(); ?>modules/mod_contactus/send.png" onclick="validateFormMod(this.form); return false;" />
		</div>
	</div>
	<div style="clear:both;"></div>

<input type="hidden" name="option" value="com_contact" />
<input type="hidden" name="view" value="contact" />
<input type="hidden" name="id" value="<?php echo $contact[1]; ?>" />
<input type="hidden" name="task" value="submit" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
{<? };( ?> )

 

 

Link to comment
https://forums.phpfreaks.com/topic/171940-parse-error/#findComment-906643
Share on other sites

My apologies, Line 61 is the last line of code but I read online that if its saying the last line of code is the problem it could actually be anywhere in the code.

 

Not 100% sure very new to this, hacing a problem with a joomla module.

 

<?php

// no direct access
defined('_JEXEC') or die('Restricted access');

if($contact[0] == false) {
echo $contact[1];
} else {
$document =& JFactory::getDocument();
$document->addCustomTag( '<script type="text/javascript" src="'.JURI::base().'media/system/js/validate.js"></script>' );
?>
<script type="text/javascript">
<!--
	function validateFormMod( frm ) {
		var valid = document.formvalidator.isValid(frm);
		if (valid == false) {
			// do field validation
			if (frm.email.invalid) {
				alert( "<?php echo JText::_( 'Please enter a valid e-mail address.', true );?>" );
			} else if (frm.text.invalid) {
				alert( "<?php echo JText::_( 'CONTACT_FORM_NC', true ); ?>" );
			}
			return false;
		} else {
			frm.submit();
		}
	}
// -->
</script>
<form action="<?php echo JRoute::_( 'index.php' );?>" method="post" name="emailForm2" id="emailForm2" class="form-validate">
	<div class="contact_email">
		<label for="contact_name">
			 <?php echo JText::_( 'Enter your name' );?>:
		</label><label id="contact_emailmsg" for="contact_email">
			 <?php echo JText::_( 'Email address' );?>:
		</label><br />
		<input type="text" name="name" id="contact_name" size="12" class="inputbox" value="" />	
		<input type="text" id="contact_email" name="email" size="12" value="" class="inputbox required validate-email" maxlength="100" /><br />
		<label for="contact_subject">
			 <?php echo JText::_( 'Message subject' );?>:
		</label>
		<br />
		<input type="text" name="subject" id="contact_subject" size="30" class="inputbox" value="" /><br />
		<label id="contact_textmsg" for="contact_text">
			 <?php echo JText::_( 'Enter your message' );?>:
		</label>
		<br />
		<div style="float:left;"><textarea style="height:50px; width:150px; overflow:auto;" cols="16" rows="2" name="text" id="contact_text" class="inputbox required"></textarea></div>
		<div style="float:left; margin-left:5px;">
		<input type="image" src="<?php echo JURI::base(); ?>modules/mod_contactus/send.png" onclick="validateFormMod(this.form); return false;" />
		</div>
	</div>
	<div style="clear:both;"></div>

<input type="hidden" name="option" value="com_contact" />
<input type="hidden" name="view" value="contact" />
<input type="hidden" name="id" value="<?php echo $contact[1]; ?>" />
<input type="hidden" name="task" value="submit" />
<?php echo JHTML::_( 'form.token' ); ?>
</form>
{<? };( ?> )

 

 

Link to comment
https://forums.phpfreaks.com/topic/171940-parse-error/#findComment-906644
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.