i am trying to make the php website to work
but it tell me Warning: Undefined variable $q in C:xampphtdocs1amyweb2.php on line 27
<?php
echo "hello"."<br>"."this is the website"."<br>"."<br>"
?>
<html>
<body>
<form action="myweb.py" method="POST">
what is your name: <input type="text" name="q"><br><br>
what is your emall: <input type="text" name="w"><br>
<input type="submit">
</form>
</body>
</html>
<?php
$fp = fopen('q.txt', 'w');
if ($fp === false) {
echo "Error opening the file";
} else {
fwrite($fp, $q);
fclose($fp);
}
?>
i tried to make $q = none in the start so win i type an input it change before it write the txt file but
it didn’t work
New contributor
إحسان الشريف is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.