b1g5l1ck Posted August 26, 2009 Share Posted August 26, 2009 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 More sharing options...
trq Posted August 26, 2009 Share Posted August 26, 2009 And line 61 is? ps : We have tags to wrap code in for easy reading. Link to comment https://forums.phpfreaks.com/topic/171940-parse-error/#findComment-906620 Share on other sites More sharing options...
PravinS Posted August 26, 2009 Share Posted August 26, 2009 Please close PHP tag ( ?> ) at the end of the code. Link to comment https://forums.phpfreaks.com/topic/171940-parse-error/#findComment-906635 Share on other sites More sharing options...
b1g5l1ck Posted August 26, 2009 Author Share Posted August 26, 2009 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 More sharing options...
b1g5l1ck Posted August 26, 2009 Author Share Posted August 26, 2009 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 More sharing options...
ILMV Posted August 26, 2009 Share Posted August 26, 2009 Change your last line to this? <?php } ?> Link to comment https://forums.phpfreaks.com/topic/171940-parse-error/#findComment-906649 Share on other sites More sharing options...
b1g5l1ck Posted August 26, 2009 Author Share Posted August 26, 2009 Thank you so much !! Its fixed. Link to comment https://forums.phpfreaks.com/topic/171940-parse-error/#findComment-906662 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.