Hi, I'm trying to send data from a form to a page called "register.php" by using the POST method. Can this be done on a localhost? I'm quite new at this and I am practicing on a localhost server with phpmyadmin. When I click the "register" button it shows the PHP code rather than submitting it to the database.

<html>
<head>
</head>

<body>
<form action="register.php" method="POST">
    Username:<br>
    <input type="text" name="username" maxlength="25"> <br><br>

    Password:<br>
    <input type="password" name="password" maxlength="20"> <br><br>

    Password confirmation:<br>
    <input type="password" name="password_confirm" maxlength="20"> <br><br>

    First name:<br>
    <input type="text" name="firstname" maxlength="35"> <br><br>

    Last name:<br>
    <input type="text" name="lastname" maxlength="35"> <br><br>

    E-mail address:<br>
    <input type="text"name="email" maxlength="35"> <br><br>
    <input type="submit" value="Register">
</form>
</body>
</html>

I am sorry if i am misreading this (I am kind of sore and tired at the moment) but are you trying to use php to collect data from your html and have it sent to a csv or an email?

Member Avatar for Zagga

Hi,
It sounds like your form is working fine, but when it gets to register.php, this page is being displayed as text rather than being parsed as code. Make sure PHP is installed and enabled on your localhost.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.