Dreamweaver Club Forums

Dreamweaver Club Forums (http://www.dreamweaverclub.com/forum//index.php)
-   Dreamweaver General (http://www.dreamweaverclub.com/forum//forumdisplay.php?f=168)
-   -   Online forms & PHP send scripts (http://www.dreamweaverclub.com/forum//showthread.php?t=50947)

vinnyvangogh 01-03-2018 03:25 AM

Online forms & PHP send scripts
 
I have separated this from my previous post. I am curious to find out why this form and PHP script stopped working. Seeming after Fast2Host got hacked and the seemed to have farmed out their clients to another hosting company - it s was OK till that DNS shift

For obvious reasons - "XXXXXXX" replaces my info!

Could somebody do an online test to check it out.
I set PHP to v5.4.0 ( certiainly started with "5" and the only v5)


#<form action="http://www.xxxxxxxxxxxxx.co.uk/sendresults.php" method="post">
<td width="116" align="right">Name</td>
<td colspan="3"><font color="#400000">
<INPUT TYPE="text" NAME="name" SIZE=30>
</font></td>
<td width="50">&nbsp;</td>
<tr>
<td align="right">Position</td>
<td colspan="3"><font color="#400000">
<INPUT TYPE="text" NAME="position" SIZE=30>
</font></td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right">Company</td>
<td colspan="3"><span class="style93">
<INPUT TYPE="text" NAME="company" SIZE=30>
</span></td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right">Telephone</td>
<td colspan="3"><span class="style93">
<INPUT TPYE="text" NAME="telephone" SIZE=30>
</span></td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right">Email</td>
<td colspan="3"><font color="#400000">
<INPUT TYPE="text" NAME="email" SIZE=30>
</font></td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right">Website </td>
<td colspan="3"><font color="#400000">
<INPUT TYPE="text" NAME="website" SIZE=30>
</font></td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right">Postal Address</td>
<td colspan="3"><span class="style93">
<TEXTAREA NAME="Postal Address" ROWS=5 COLS=30></TEXTAREA>
</span></td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right">Enquiry</td>
<td colspan="3"><span class="style93">
<TEXTAREA NAME="Enquiry details" ROWS=5 COLS=30>
</TEXTAREA>
</span></td>
<td>&nbsp;</td>
</tr>
<tr>
<td align="right">How Did You Find Me?</td>
<td colspan="3"><TEXTAREA NAME="How Did You Find Us" ROWS=2 COLS=30></TEXTAREA></td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td colspan="2"><input type="submit" value="Submit" name="submit"></td>
<td width="399"><input type="reset" name="reset"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="5">&nbsp;</td>
</tr>

</form>












<?php
//--------------------------Set these parameters--------------------------

// Subject of email sent to you.
$subject = 'Results from Contact form';

// Your email address. This is where the form information will be sent.
$emailadd = 'XXXXXXXX@hotmail.com';

// Where to redirect after form is processed.
$url = 'http://www.XXXXXXXXXXXX.com/confirmation.html';

// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';

// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '1')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>

edbr 01-03-2018 09:58 AM

that looks like the old mailing script from here. check that your hosting accepts php mail() some hosters require smpt for authorization,

vinnyvangogh 01-03-2018 07:42 PM

Quote:

Originally Posted by edbr (Post 220692)
that looks like the old mailing script from here. check that your hosting accepts php mail() some hosters require smpt for authorization,

Spot on.....Contacted the hosting..... got this back..

Hi

I cannot find any authentication in your script.

All email sent via our mail server must be authenticated with a valid email server, email address and password.

As the site does not use us for email, you will need to authenticate with the Gmail credentials.

Regards,
Steve

Fast2host Ltd
http://www.fast2host.com
01480 260 000
Twitter: @fast2host
Facebook: https://www.facebook.com/fast2host

edbr 01-04-2018 12:34 AM

use phpmailer or swift mail. i have a zip for using phpmailer. if not in my download link ill look it out when i have time


All times are GMT. The time now is 03:22 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com