0

I have created an account an account on insightly web to get contacts from my web to the CRM throught which I created an HTML form to do so.

But on a page i also want to get information to show on the page which is entered by the user like when he clicks o submit on the next page the info can also be shown.

To do that I have created a php script which we always do so to get info using $_POST method. Here is the code for the HTML form below:

<form name="insightly_web_to_contact" action="https://hsyxkqpg.insight.ly/WebToContact/Create" method="post" id="frm" onsubmit="return validatechk()>

<input type="hidden" name="formId" value="FzCeWqL/hiOQUb5fmRQm6w=="/>

<label for="insightly_firstName"></label>
<input id="insightly_firstName" class="text-field1" name="FirstName" type="text" placeholder="Name*"/>

<input type="hidden" name="emails[0].Label" value="Work"/><label for="email[0]_Value"></label><input id="emails[0]_Value" class="text-field1" name="emails[0].Value" type="text" placeholder="E-Mail*"/>

<input type="hidden" name="phones[0].Label" value="Work"/><label for="phones[0]_Value"></label><input id="phones[0]_Value" class="text-field1" name="phones[0].Value" type="text" placeholder="Phone*"/>

<input type="hidden" name="addresses[0].AddressType" value="Home" /><label for="addresses[0]_Street"></label><input id="addresses[0]_Street" class="text-field1" name="addresses[0].Street" type="text" placeholder="Street Address*"/>

<label for="addresses[0]_City"></label><input id="addresses[0]_City" class="text-field2" name="addresses[0].City" type="text" placeholder="City*" />

<label for="addresses[0]_State"></label><input id="addresses[0]_State" class="text-field2" name="addresses[0].State" type="text" placeholder="State*"/>

<label for="addresses[0]_PostalCode"></label><input id="addresses[0]_PostalCode"  class="text-field2" name="addresses[0].PostalCode" type="text" placeholder="ZipCode*" />

<input type="submit" name="submit" value="Check Availability" id="button"/>
</form>

and below is the php code which I had created and above html was generated from the website:

<?php
$name=$_POST['FirstName'];
$pass=$_POST['emails[0].Value'];
$address=$_POST['addresses[0].Street'];
$city=$_POST['addresses[0].City'];
$state=$_POST['addresses[0].State'];
$zipcode=$_POST['addresses[0].PostalCode'];
$mobile=$_POST['phones[0].Value'];

if(isset($_POST['submit']))

echo "$name" . "$address" . "$city" . "$state" . "$zipcode" . " $mobile" ;
}
?>`

so the main problem is that I am unable to get data from the form to echo on the web page.

3
Contributors
11
Replies
49
Views
3 Years
Discussion Span
Last Post by albucurus
0

you are missing starting braces of if statement { at line 11.
you can also use in this form i have check this.

echo $name=$_POST['FirstName'];

Edited by sikander123

0

Try this in your php code:

if(isset($_POST['submit']))
{
    echo "$name  $address   $city  $state  $zipcode  $mobile" ;
}
0

Tried both but not retrieving still. When I had created custom not insightly the form was working and php script was working as wel and retrieving information. but now it's not happeing still required help.

0

@sikander123 yes thank you it was mistaken while writning the post :).

But not working now as well any more suggesstion.

Data is successfully inserting to CRM but not listneing my script.

0

I wasnt very carefully first time.
action attribute of form tag is the problem. This atribute must have the value of your php file which generate de response page, like your php code.

<form name="insightly_web_to_contact" action="**here must be your php file**" method="post" id="frm" onsubmit="return validatechk()>

If html code and php code are in same file, action take the value of that file.

0

yes this is the main problem and if i change the action the form will work according to my php not will send the data to insightly website :(... big tentionn

0

The url you put in action isn't complete. you give just the path, the file missing.
The php code must be in the file which you dont give in action.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.