PHP page giving an error
Posted by: Wysk (---.cm-12-3c.dynamic.ziggo.nl)
Date: June 08, 2016 05:31PM

Hey everyone so recently my php page is doing weird/not working at all, I haven't had any trouble with it first, didn't make any major changes to it but somehow it stopped working now.

this is the php code I am using:

<html>

<head>
<title>Bedankt voor uw bericht...</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
<script type="text/javascript">
setTimeout("window.close();", 3000);
</script>
<script src="[code.jquery.com];
</head>

<body>
<?php
$name = $_POST['name'];
$surname = $_POST['surname'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: '$name + $surname;
$to = 'resetdesigners@gmail.com';
$subject = $_POST['subject'];

$body = "From: $name + $surname\n E-Mail: $email\n Message:\n $message";
?>

<?php
if ($_POST['submit']) {
if (mail ($to, $subject, $body, $from)) {
echo '<h1>Bedankt voor je email!</h1>';
} else {
echo '<h1>Probeer het opnieuw lul je hebt het niet goed ingevuld</h1>';
}
}
?>

</body>

</html>


and this is the specifying contact form:



<div class="contactform">

<form id="myForm" action="form.php" method="post" enctype="multipart/form-data" target="_blank">

<label></label>
<input class="apparte" name="name" required="required" placeholder="Uw voornaam..." id="naamvak">

<label></label>
<input class="apparte" name="email" type="email" required="required" placeholder="Bijv.: jouwemail@voorbeeld.nl">

<label></label>
<input class="apparte" name="subject" type="subject" required="required" placeholder="Bijv.: responsive site">


<label></label>
<textarea name="message" cols="20" rows="5" required="required" placeholder="Typ hier uw vraag..."></textarea>


<input id="cancel" name="cancel" type="reset" value="Opnieuw" />

<input id="submit" name="submit" type="submit" value="Verzenden">

</form>


</div>

So yeah it worked and all but now it just gives an error, this is the error...

[gyazo.com]

translation:

"This page on 15775.hosts.ma-cloud.nl isn't working."
"15775.hosts.ma-cloud.nl can't process this request at this moment."

This is a local host, but I also tried this on my own webhost but it just gave the same error.

Options: ReplyQuote
Re: PHP page giving an error
Posted by: RiggsFolly (Moderator)
Date: June 08, 2016 08:06PM

Then I guess wherever you say it worked was doing a good job of hiding errors generated by very bad PHP code.

WOuld you like to look at the PHP Error log and show us what is listed in there

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: PHP page giving an error
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 14, 2016 07:54AM

To get to the PHP log file:

- click the WAMP icon in the system tray
- click PHP
- click PHP error log

That should open the PHP error log file - see if you can find error messages logged when the error occurs.

If yout want to start with an empty log file and then do some testing - to empty the PHP error log:

- right click the WAMP icon in the system tray
- click Tools
- cllick Empty PHP error log

Then do whatever it takes to get the error.

Then open and look for error messages in the PHP error log.

Options: ReplyQuote
Re: PHP page giving an error
Posted by: SimonT (---.lightspeed.stlsmo.sbcglobal.net)
Date: June 14, 2016 07:56AM

ALSO - I should have said, to start my original reply:

It looks like a cloud server is not working - 15775.hosts.ma-cloud.nl

You need to contact the support people there to find out what is wrong at their end.

Options: ReplyQuote


Sorry, only registered users may post in this forum.