logo-dw

Go Back   Dreamweaver Club Forums > Dreamweaver forums > Dreamweaver General
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 01-03-2018, 03:25 AM   #1
vinnyvangogh
 
Join Date: Aug 2009
Posts: 88
Default 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.'">';
?>
vinnyvangogh is offline   Reply With Quote
Old 01-03-2018, 09:58 AM   #2
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,201
Default

that looks like the old mailing script from here. check that your hosting accepts php mail() some hosters require smpt for authorization,
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Old 01-03-2018, 07:42 PM   #3
vinnyvangogh
 
Join Date: Aug 2009
Posts: 88
Default

Quote:
Originally Posted by edbr View Post
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
vinnyvangogh is offline   Reply With Quote
Old 01-04-2018, 12:34 AM   #4
edbr
edbr's Avatar
 
Join Date: Aug 2005
Location: Bali
Posts: 11,201
Default

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
__________________
If you're happy and you know it shake your meds!
different style links examples

Flight / Hotel search
Free script download
Bali Villas
edbr is offline   Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:24 AM.


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