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.

Recommended Answers

All 11 Replies

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'];

Try this in your php code:

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

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.

@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.

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.

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

55e66e8ee69e48cfc0a2370cc0f63a2f

This post has no text-based content.

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.