vtiger Forum Index vtiger
The Honest Open Source CRM
 

Submitted web form, but no lead appears
Click here to go to the original topic

 
       vtiger Forum Index -> Web Forms
Previous topic :: Next topic  
Author Message
jshayler



Joined: 03 Jul 2007
Posts: 77

Posted: Fri Dec 28, 2007 2:02 pm    Post subject: Submitted web form, but no lead appears  

All,

I have been trying to get this to work for three days now, I have installed the webforms and it appears to be working, when i fill in all the fields and click submit it takes me to a blank screen with one option of "home" on it.

But the lead never appears in my leads home page. I really dont know where i have gone wrong????????

I have attached all the code from the webform/leads and a link to the web site with the webform on it below:-

http://www.enterprise.power4pubs.co.uk/webforms/Lead/index.php

CONFIG.PHP


Code: <?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
*
 ********************************************************************************/


//$Server_Path   = 'http://servername:port_number';    //This is the path where have you run ther vtiger server.
//JS //$Server_Path   = 'http:www.crm.power4pubs.co.uk'

$Server_Path = 'http://localhost:/crm';

$proxyhost     = '';                //This is the proxy host
$proxyport     = '';                //This is proxy port
$proxyusername = '';               //This is the proxy setting user name
$proxypassword = '';               //This is the proxy setting password

//Default (1) is admin user id. if you want to assign the contacts to a vtiger user then you can give the user id
$assigned_user_id = 1;


?>


INDEX.PHP

Code: <?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
*
 ********************************************************************************/


if($error_message != '')
   echo '<h6><font color="purple">'.$error_message.'</font></h6>';

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>

<script language="Javascript">

String.prototype.trim = function() {
a = this.replace(/^\s+/, '');
return a.replace(/\s+$/, '');
};

function ValidateForm(){
   var str=document.leadform.email.value;
   var lname = document.leadform.lastname.value;
   var company = document.leadform.company.value;   
   
   if(lname.trim() == ''){
                alert("Last name required..");
                return false;
        }else if(company.trim() == ''){
      alert("Company name required .. ");
      return false;
   }

   if((str.lastIndexOf(".") > 2) && (str.indexOf("@") > 0) && (str.lastIndexOf(".") > (str.indexOf("@")+1)) || (str==''))
      document.leadform.submit();
   else   
      alert('Invalid Email Id');
 }

</script>

<style>
   h3{margin:0; font-size: 14px;}
   hr{color: #EEE; background-color: #EEE; margin: 0; height:1px; }
   body { color: #333333; font-size: 11px; font-family: verdana, sans-serif }
   table#perfect         { background-color: #F5F5F5; border: 1px solid #CCC;}
   table#perfect caption { color: yellow; font-size: 110%; font-weight: bold;
                           background-color: black; padding: 3px;
                           margin-left: auto; margin-right: auto }
   table#perfect th      { text-align: right; font-weight: bold }
   table#perfect div     { text-align: center; margin-top: 6px }
   table#perfect span    { float: right; font-size: 65% }
   table#perfect a       { color: darkslategray; text-decoration: none }
   input.click           { cursor: pointer }
</style>

</head>
<body>


<form name="leadform" method=post action="send_data.php">
<input type="hidden" name="create" value="lead">

<table width="50%" align="center">
   <tr>
      <td align="left"><h3>Lead Details</h3></td>
      <td width="75%"><hr width="100%"></td>
   </tr>
</table>

<table cellspacing="0" cellpadding="5" border="0" id="perfect" width="50%" align="center">
      <tr><th>Last Name:<font color="#CC0000"><sup>*</sup></font> </th>
            <td><input type=text name=lastname size=30 value="<?php echo $_POST['lastname']?>"></td>
      </tr>
      <tr><th>Your E-Mail:</th>
            <td><input type=text name=email size=30 value="<?php echo $_POST['email']?>"></td>
      </tr>
      <tr><th>Phone:</th>
            <td><input type=text name=phone size=30 value="<?php echo $_POST['phone']?>"></td>
      </tr>
      <tr><th>Company:<font color="#CC0000"><sup>*</sup></font> </th>
            <td><input type=text name=company size=30 value="<?php echo $_POST['company']?>"></td>
      </tr>
      <tr><th>Country:</th>
            <td><input type=text name=country size=30 value="<?php echo $_POST['country']?>"></td>
      </tr>
      <tr><th>Description:</th>
         <td><textarea name=description rows=2 cols=29><?php echo $_POST['description']?></textarea></td>
      </tr>

   <tr><td colspan="2" align="center">
      <input type="button" name="Submit" value="Submit" class=click onClick="ValidateForm();"></td></tr>
   </table>
</form>
</body>
</html>


SENDDATA.PHP

Code: <?php
/*********************************************************************************
** The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
*
 ********************************************************************************/

include("config.php");
require_once('nusoap/lib/nusoap.php');

$client = new soapclient2($Server_Path."/vtigerservice.php?service=webforms", false,
                                                $proxyhost, $proxyport, $proxyusername, $proxypassword);
$err = $client->getError();

if($_REQUEST['create'] == 'lead')
{
   $lastname = $_POST['lastname'];
   $email = $_POST['email'];
   $phone = $_POST['phone'];
   $company = $_POST['company'];
   $country = $_POST['country'];
   $description = "WebForm : ".$_POST['description'];

   $params = array(
            'lastname' => "$lastname",
                      'email'=>"$email",
                      'phone'=>"$phone",
                      'company'=>"$company",
                      'country'=>"$country",
                      'description'=>"$description",
                      'assigned_user_id'=>"$assigned_user_id"
         );

   if($lastname != '' && $company != '')
   {
      $result = $client->call('create_lead_from_webform', $params, $Server_Path, $Server_Path);
   
      if($result['faultstring'] != '' && is_array($result))
      {
         echo '<br>'.$result['faultstring'];
      }
      else
      {
         echo '<br><br>'.$result.'<br><br><a href="index.php">Home</a>';
      }
   }
   else
   {
      $error_message = "<h3>Last Name and Company must be entered to create a Lead.</h3>";
      include("index.php");
   }
}
else
{
   include("index.php");
}

?>


Have I missed something? why will it not work? Any ideas would be great, and many thanks to all who help in advance

J
Back to top  
prasad.a



Joined: 01 Aug 2007
Posts: 1035

Posted: Sat Dec 29, 2007 6:02 am    Post subject: Submitted web form, but no lead appears<br /><a hre  

Hi J,

Your ServerPath should read:
$Server_Path = 'http://www.crm.power4pubs.co.uk';

and make sure it can be reached from:
http://www.enterprise.power4pubs.co.uk/webforms/Lead/index.php

Regards,
Prasad
vtiger Team
Back to top  
jshayler



Joined: 03 Jul 2007
Posts: 77

Posted: Sat Dec 29, 2007 8:35 am    Post subject: Submitted web form, but no lead appears<br /><a hre  

In which file should the server path $Server_Path = 'http://www.crm.power4pubs.co.uk'; ???

If its the config.php file i have tried this and it gives me error messages, please see my other post:-

http://forums.vtiger.com/viewtopic.php?t=17796

Not sure now???

J
Back to top  
jshayler



Joined: 03 Jul 2007
Posts: 77

Posted: Thu Jan 03, 2008 9:29 am    Post subject: Submitted web form, but no lead appears<br /><a hre  

Fixed - Please see the below Post:-

http://forums.vtiger.com/viewtopic.php?p=58943#58943
Back to top  
 
       vtiger Forum Index -> Web Forms
Page 1 of 1


Powered by phpBB Search Engine Indexer
Powered by phpBB 2.0.15 © 2001, 2002 phpBB Group