Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9020765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:06:03+00:00 2026-06-16T05:06:03+00:00

So I have been asked to insert rows to this database using a html

  • 0

So I have been asked to insert rows to this database using a html form. Here’s the code of the form:

<html>
<body>
<div id="header1">
  <h1>Donar d'alta un client</h1>
</div>
<hr>
<form action="alta.php" method="post">
    Numero: <input type="text" name="cnumero" /><br>
    Nom: <input type="text" name="cnom" /><br>
    Adreca: <input type="text" name="cadreca" /><br>
    Codi Postal: <input type="text" name="ccp" /><br>
    Poblacio: <input type="text" name="cpob" /><br>
    Dni: <input type="text" name="cdni" /><br>
    Email: <input type="text" name="cemail" /><br>
    <input type="submit" value="Afegeix" />
</form>
<hr>
</body>
</html>

That’s a normal form, nothing special, it works.
Now here it comes the problem. In the file alta.php, I have the PHP code to insert all this information in a row of this existing table. The table is called CLIENT and it has all this parameters and 3 more which have to be NULL when you add a new row. Here’s the code of alta.php :

<html>
<body>
<?php
include 'vars.php';
ini_set('display_errors', 1);
error_reporting(E_ALL);

$numero= $_POST['cnumero'];
$nom= $_POST['cnom'];
$adreca= $_POST['cadreca'];
$codi_postal= $_POST['ccp'];
$poblacio= $_POST['cpoblacio'];
$dni= $_POST['cdni'];
$email= $_POST['cemail'];

$conn = oci_connect('u*******', 'u*******', '********');

if (!$conn) {
    $e = oci_error();
    trigger_error(htmlentities($e['No em connectat a la BD'], ENT_QUOTES), E_USER_ERROR);
}

$stid = oci_parse($conn, "INSERT INTO client 
                                    (client_num, client_nom, client_adreca, client_codi_postal, client_poblacio, client_dni, client_email)
                          VALUES
                                    (:client_num, :client_nom, :client_adreca, client_codi_postal, :client_poblacio, :client_dni, :client_email)");

oci_bind_by_name($stid, ":client_num", $numero);
oci_bind_by_name($stid, ":client_nom", $nom);
oci_bind_by_name($stid, ":client_adreca", $adreca);
oci_bind_by_name($stid, ":client_codi_postal", $codi_postal);
oci_bind_by_name($stid, ":client_poblacio", $poblacio);
oci_bind_by_name($stid, ":client_dni", $dni);
oci_bind_by_name($stid, ":client_email", $email);


    $r = oci_execute($stid);


    if ($r) { echo 'Client afegit correctament.'; }
    if (!$r){ echo 'Hi ha hagut un error.'; }

    oci_free_statement($stid);
    oci_close($conn);   
?>
        <br><br><br>
        <div id="tornar">
            <li><a href="index2.html">Tornar a l'inici</a></li>
        </div>
</body>
</html>

The problem is my browser keeps saying there’s an ‘Internal Server Error’. So apparently there’s a piece of this code which doesn’t work. Could you guys help me a bit? I’ve spent way too much time thinking about it and I can’t see what’s wrong.

Thanks a lot !

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T05:06:04+00:00Added an answer on June 16, 2026 at 5:06 am

    It looks like the input names in your form don’t match what you are trying to get from $_POST in your PHP code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This has probably been asked many times but here it goes : I have
I have been asked to write a script that pulls the latest code from
I have been asked by my supervisor to develop a web application using either
I have been asked to look into FileMaker for creating a pretty simple database
This is a homework problem that i have been asked to do. Create an
I have been asked this question in interview how does XML and Soap work
I'm sure this would have been asked before, but I'm very confused! Say I
This question have been asked by several people but my problem seems to be
I know similar permutations of this question have been asked before, but the answers
It looks like this question has been asked before, here and in other places

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.