Issue with PHP Script with RSD 1.5...

User 2628633 Photo


Registered User
2 posts

I have developed a contact form using RSD 1.5.
The form contains 4 Input fields and a Submit (Send) button.

On the Element for the Submit button, in the Method I have specified “Post” and in the Action field I have specified a PHP script, BucksTest.php.

When I click on the Send button, I am receiving a HTTP ERROR 505. Now my web host correctly handles other PHP scripts that are integral to other websites I have on the host, so that is not the problem.
The script looks like the following:
<?php
/* Set e-mail subject & recipient */
$recipient = 'rdelaet@doccons.com';
$yourname = $_POST['text-name'];
$companyname = $_POST['company-name'];
$emailaddress = $_POST['email-address']);
$phonenumber = $_POST['phone-number'];
$date = date('Y-m-d H:i:s');

/* Prepare the message for the e-mail */
$message =

"The BucksITC contact form has been submitted by:

Name: $yourname
Company Name: $companyname
E-mail: $emailaddress
Phone Number: $phonenumber
Date and Time: $date

End of message
";

/* Send the message using mail() function */
mail($recipient, "Customer Request from ITC Contact Us Form", $message);

/* Redirect visitor to the thank you page */
header('Location: Thanks.html');
exit();
?>

Can anyone tell me why the PHP script is not executing?
Attachments:
User 122279 Photo


Senior Advisor
14,649 posts
Online Now

I'm not php savvy, so I can't say anything about the actual script itself. But RSD cannot handle php within the programme, so the script has to be in a separate file, included as a 'php include' in a html element. And finally the script file has to be uploaded separately. And you have to make sure that the server can parse php in html files.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 53435 Photo


Registered User
79 posts

Using PHP with RSD is just fine. I do it all the time. And in this case the PHP is no in the html file, it is an action script for a form submission.
A 505 error is an unusual one, meaning that the server is complaining about the http version requested by the client.

Although the script lacks any sort of anti-spamming or field verification and sanitising, it is fundamentally sound.
I'd suggest having a look at the error in the httpd server error log when the script is submitted.

Also, check the <form> part of your form to see that the method, action and enctype are appropriately set. They look OK from the image attached, however it is worth checking the final html file as well.


User 187934 Photo


Senior Advisor
20,271 posts

I would remove those dashes in the variables.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 515127 Photo


Registered User
116 posts

Hi - my general process for trouble-shooting this kind of issue to drill thru the steps to see where it breaks.

I would execute a simple PHP script that just confirms the script is executing (tells me at least I got to the script).
<?php
echo "Got Here!";
exit();
?>

If that fails, then look at your action= statement in the form to make sure there isn't a typo or a path problem.

Or if that works, then next step - echo each of the variables to the screen, make sure something isn't fubar there.

Then echo the message body content to screen.

Then hardcode a mail() call to confirm that your script is permitted to send mail by the server.

99 times out of 100 - by this point in time, I will have found the culprit.

Hope this helps,
Regards - Gordon

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.