# Problem in Form Submission in Web Easy Pro 8



## vivekatvraja (Jan 3, 2012)

after the filling of the form in Web Easy Pro 8, the submit button is redirecting me nowhere, nor am i rcvin ny mail... my php code for form submission is as follows:

```
<?php

$SendFormTo = '[email protected]';
$emailsubject = 'Careers';

$Name = $_POST['Name']; 
$Address = $_POST['Address'];
$Date = $_POST['Date'];
$Phone = $_POST['Phone'];
$Email = $_POST['Email'];
$Country = $_POST['Country'];

$body = "

 Name: $Name
 Address: $Address
 Date: $Date
 Phone number: $Phone
 Email: $Email
 Country: $Country

";

$headers = "From: $Email";
$success = mail($SendFormTo, $emailsubject, $body, $headers);

header( "Location: http://www.facebook.com" );
?>
```


----------



## wmorri (May 29, 2008)

Hi

Welcome to TSF!!

Can you also post the html that you have for the form too.

Thanks


----------



## vivekatvraja (Jan 3, 2012)

```
<form id="f16" action="formmailer.php" method="post" onsubmit="return weCheckForm(this)">
<fieldset id="e16" class="cc12">
    <legend id="e15" class="cc13">
        Contact Details
    </legend><br>
    <label id="e14" class="cc14" for="e13">
        Name
    </label>
    <input id="e13" class="cc15" type="text" name="Name" title="Name" size="22"><br>
    <label id="e12" class="cc14" for="e11">
        Address
    </label>
    <input id="e11" class="cc15" type="text" name="Address" title="Address" size="50"><br>
    <label id="e10" class="cc14" for="e9">
        Date
    </label>
    <input id="e9" class="tcal" type="text" name="Date" title="Date" size="11"><br>
    <label id="e8" class="cc14" for="e7">
        Phone
    </label>
    <input id="e7" class="cc15" type="text" name="Phone" title="Phone" size="22"><br>
    <label id="e6" class="cc14" for="e5">
        E-mail
    </label>
    <input id="e5" class="cc15" type="text" name="Email" title="E-mail" size="22"><br>
    <label id="e4" class="cc14" for="e3">
        Country
    </label>
    <select id="e3" class="cc16" size="1" name="Country" title="Country">
    <option> Afghanistan</option>
    <option> Albania</option>
    ....
    <option> Zambia</option>
    <option> Zimbabwe</option>
    </select><br>
    <input id="e2" class="cc16" type="submit" title="Send Details" value="Send Details">
    <input id="e1" class="cc16" type="reset" title="Clear Details" value="Clear Details">
</fieldset>
</form>
```
tcal refers to a JS tat displays a drop-down menu, a mini calender.


----------



## wmorri (May 29, 2008)

I am going to work on this tonight and come up with something for you for tomorrow.


----------



## Laxer (Dec 28, 2010)

First things first lets turn on error tracking... add this to your code:

```
error_reporting(E_ALL);
ini_set('display_errors', '1');
```
Next thing....

can you provide everything in the file: formmailer.php


----------



## vivekatvraja (Jan 3, 2012)

currently d contents of formmailer.php is as follows:

```
<?php

    $EmailSub = 'trail';
    $EmailAddr = '[email protected]';

    $NameField = $_POST['Name']; 
    $AddressField = $_POST['Address'];
    $DateField = $_POST['Date'];
    $PhoneField = $_POST['Phone'];
    $EmailField = $_POST['Email'];
    $CountryField = $_POST['Country'];

    $body = "
Name: $NameField\n
Email: $EmailField\n
Address: $AddressField\n
Date: $DateField\n
Phone Number: $PhoneField\n
Country: $CountryField\n
";

    $headers = "From: $EmailField\r\n";
    $headers .= "Content-type: text/html\r\n";
    if (mail($EmailAddr, $EmailSub, $body, $headers))
    {    echo 'Details Sent...';    }
    else
    { echo 'Unsuccessful...';    }
    
    
    error_reporting(E_ALL);
    ini_set('display_errors', '1');
?>
```
i added d if-else conditions to see if atlst either of d outputs r displayed, bt of no use. also in d control panel, administratv tools->iis [...]->applicatn config, i selected php n configured...bt no use. all i hv bn getting is the blank page


----------



## Laxer (Dec 28, 2010)

Create a new page for me... (must be php)

and have just the code

```
<?php phpinfo(); ?>
```
Then can you provide me the link to this page?

If not load it then right click it and save it then upload it here


----------



## vivekatvraja (Jan 3, 2012)

u mean i replace d code in d formmailer wit d code u gave...click submit n c d reaction??? k, nyhw it ws still a blank page
as u sed, i rite clickd on d page saved it as form_trail.php. well d only content in d pg is d code itself

<?php phpinfo(); ?>

n 1 mre thng to brng to ur notice if its of ny imp...no php file opens in my sys directly, i opn it usin notepad++. evnthough php icon is visible, n riteclick->open with->CLI, nothng opns or happns...is it normal???


----------



## wmorri (May 29, 2008)

Hi,

What Laxer is asking you to do is to make a new file in notepad++, and name it phpinfo.php. Then simple add the text that he has given you. Upload it to your webserver and open it in a web browser. 

Once you have uploaded it if you can post a link to the webpage so that we can see what php specifications are running on your webserver. 

If you don't have a web address that we all can see, like you are hosting the server on your local machine then load the page then right click it and save it then upload it here.


----------



## vivekatvraja (Jan 3, 2012)

m nt ashamed to say tis, bt yea...i dnt knw hw to go abt tis, though i undrstud its needs evn b4 i joind tis forum
i did dwnload filezilla client n server, ran thru a couple of youtube videos as to hw to install n use...n i almost crashed my system trying to do tat, well coz i cudnt find a single video/blog wer d domain of use of ech filezilla client/server ws xplained. by nw, quite obviously u cn conclude, i hv no access to ny host/domain name or watevr. further searching fr solutions...i ended up reconfiguring my sys, ctrl panel -> admin tool -> iis, etc...thot tis cud serv my purpose...bt no...thus wile googling fr soln posted d ques in tis forum. by nw i hd undrstud hw these thngs wrkd, still cudnt mk it wrk...
so humble req, pls do spare sm tym wit me n help me out, or gv ny links to sites/blogs/videos wich v clearly xplains wat 2 do...
m nt able to test d web pgs i cud develop xcpt fr viewin them...also m wrkin on applets fr live chat in d site...though i developed the code, m nt able to test/simulate d whole scenario of live chat...coz i dnt knw/hv access to server side issues...


----------



## Laxer (Dec 28, 2010)

Please try and speak with proper english. Using shortened words and abbreviations make your posts hard to understand.

First things first...

Can you FTP to your server?


----------



## vivekatvraja (Jan 3, 2012)

Sorry for the abbreviated & shortened English, its too common here at my place...
No sir, I'm not connected to any FTP server yet.
Googled as to how to get connected to one, cm across filezilla server - installed it... Installed filezilla client in my friend's another system...something went wrong i guess. It just din't work. Reinstalled server again on my system, couldn't touch my friend's system now - so installed filezilla client on my system. While the server was running, started filezilla client - dint know or have any hostname [etc,etc].....went nowhere with that


----------



## wmorri (May 29, 2008)

I believe what laxer was talking about and you answered it was if you connect to a FTP server to upload your website anywhere, and you don't. 

We can help you with connecting to a FTP server if you want, it is pretty easy.


----------



## vivekatvraja (Jan 3, 2012)

aww maan...thnx a lot. the thing is i dint find any public FTP server[hope this is what it is called] available. would sure be glad to accept help...


----------



## Laxer (Dec 28, 2010)

Who is your host? or are you hosting yourself? (local host)


----------



## vivekatvraja (Jan 3, 2012)

its more of the second part in my case. just making a few bucks,these vacations, designing d website for a medium-scale company, with whom no direct contact exists. i had d requirement analysis done & finalized d corresponding documentation/layouts/content. so learnt web easy, a bit of adobe indesign. now just want to test the scripts, particularly of form submission, n live-chat applet... it is local host at my level


----------



## vivekatvraja (Jan 3, 2012)

I am still in need of help....


----------



## Laxer (Dec 28, 2010)

If it's a local host find the www/webroot folder on your machine...

Usually it is C:\Inetpub\wwwroot

or inside the local WAMP/XAMPP server folder.

If the host is local you shouldn't have to ftp.


----------



## vivekatvraja (Jan 3, 2012)

i already did that... if i am not wrong i have to access it by ftp://ip_addr/file_name.html...done that... everything is fine n working except for the php scripts... any form i fill n click on submit - it only takes to a blank page (though i have redirected it to a particular page at submission) n i also receive no mail (which has to be sent when mail(); is executed)


----------



## Laxer (Dec 28, 2010)

Sorry I was unaware that you already could FTP.


Make sure the file: formmailer.php is in the same folder as the form.

Please note the name of this file can be case sensitive.

When you view the page formmailer.php by linking to it manually (domain.com/folder/formmailer.php)

do you get a blank page or?


----------

