Hi there
I'm trying to integrate a joomla form into sugar by making a lead capture. But I' getting the following message after submitting:
You are not allowed to access this URL
I followed the tutorial from the sugar wiki:
http://www.sugarcrm.com/wiki/index.p...orm_submission
I created a form with a form component in joomla, chronoforms, like the in one i wiki:
The next I did was to create a file called leadCapture_override.php:Code:Welcome to my awesome lead capture form!<br> <br> <br> <form name="lead_capture" action="http://www.mysite/crm/leadCapture.php" method="post"> <input type='hidden' name='redirect' value='http://www.sugarcrm.com'> <input type='hidden' name='lead_source' value='Web site'> <input type='hidden' name='user' value='my_lead_capture_form'> First Name: <input type='text' name='first_name'> <br> Last Name: <input type='text' name='last_name'> <br> Description: <select name="description"> <option value="Sugar is good">Sugar is good</option> <option value="Sugar is great">Sugar is great</option> <option value="Sugar is the greatest">Sugar is the greatest</option> </select><br> <input type='Submit' name='submit' value='Submit' > </form> </body>
Now when it comes to redirect part, I'm not sure what to do. The leadCapture.php file already has some code in it, so what I did, was to insert the piece of code for the redirect right before the php closing tags:Code:<? $users = array( 'my_lead_capture_form' => array( 'name' => 'my administrator username goes here', 'pass' => 'MD5 hash goes here' )); ?>
Hope someone can help.Code:<?php if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); header('HTTP/1.1 301 Moved Permanently'); header('Location: index.php?entryPoint=leadCapture&'.$_SERVER["QUERY_STRING"]); if(isset($_POST['redirect']) && !empty($_POST['redirect'])){ //header("Location: ".$_POST['redirect']); echo '<html><head><title>SugarCRM</title></head><body>'; echo '<form name="redirect" action="' .$_POST['redirect']. '" method="POST">'; foreach($_POST as $param => $value) { if($param != 'redirect') { echo '<input type="hidden" name="'.$param.'" value="'.$value.'">'; } } if( ($return_val == '') || ($return_val == 0) || ($return_val < 0) ) { echo '<input type="hidden" name="error" value="1">'; } echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>'; echo '</body></html>'; } else { echo "Thank You For Your Submission."; } ?>
I use:
windows prof, Version 5.2.0f (Build 5688) Community edidtion, Apache/2.2.3 (Debian) , PHP 5.2.9-0.dotdeb.1 , MySQL server ver. 5.0.32 , joomla 1.5.14


LinkBack URL
About LinkBacks



Reply With Quote


Bookmarks