|
|
Posted by sebby.001 on 11/15/07 18:29
On Nov 15, 4:30 pm, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On Nov 15, 2:21 pm, sebby....@gmail.com wrote:
>
>
>
> > if any one out there can help me with this problem I would be very
> > greatful.
>
> > I have created a database to store new registered members to my
> > website but when data is sent to my database table, the entire row is
> > blank except for the automated id number.
>
> > I have searched in many places and have not been able to resolve this
> > problem.
>
> > Below is a copy of my page, the database connection is from another
> > page for security.
>
> > <html>
>
> > <head>
> > <meta http-equiv="Content-Type" content="text/html;
> > charset=windows-1252">
> > <title>Members</title>
> > <style type="text/css">
> > <!--
> > body,td,th {
> > font-family: Georgia, Times New Roman, Times, serif;
> > font-size: 12px;}
>
> > h1 {
> > font-size: 18px;
> > padding-bottom: 2px;
> > border-bottom-width: 1px;
> > border-bottom-style: solid;
> > border-bottom-color: #CCCCCC;
> > font-style: normal;}
>
> > form {
> > margin-left: 20px;}
>
> > -->
> > </style>
> > <?php
> > require('dbConn.php');
> > ?>
> > </head>
>
> > <body>
> > <?
> > if ($_GET['mode'] == "add")
> > {
> > //////////////////////////////////Register Members to
> > DB//////////////////////////////////////////
> > $sql = "INSERT INTO members
> > (member_id,name,address,city,county,postcode,telephone,mobile,email,username,password)
> > VALUES ( '', '$name', '$address', '$city', '$county', '$postcode',
> > '$telephone', '$mobile', '$email', '$username', '$password' )";
> > if ( @mysql_query($sql) )
> > {
> > echo "<hr size=1 class=dottedlinebox class=lines> <font color=0099FF
> > face=verdana size=2>Your have succesfully registered <b><font
> > color=black>".$username."</font></b> as your account!</font><hr
> > size=1>";
> > ?>
> > <?
> > exit;
> > }else
> > {
> > echo mysql_error();
> > }
> > }
> > ?>
> > </span>
> > <?
> > echo "<h2>".$msg."</h2>";
> > ?>
>
> > <fieldset style="padding: 2">
> > <legend>Register</legend>
> > <form action="index.php?mode=add" method="post" enctype="multipart/
> > form-data" name="form">
> > <p>Name: <input type="text" name="name" class="textfield" id="name"
> > size="20"></p>
> > <p>Address: <input type="text" name="address" class="textfield"
> > id="address" size="20"></p>
> > <p>City: <input type="text" name="city" class="textfield" id="city"
> > size="20"></p>
> > <p>County: <input type="text" name="county" class="textfield"
> > id="county" size="20"></p>
> > <p>Postcode: <input type="text" name="postcode" class="textfield"
> > id="postcode" size="20"></p>
> > <p>Telephone: <input type="text" name="telephone" class="numberfield"
> > id="telephone" size="20"></p>
> > <p>Mobile: <input type="text" name="mobile" class="numberfield"
> > id="mobile" size="20"></p>
> > <p>Email: <input type="text" name="email" class="textfield"
> > id="email" size="20"></p>
> > <p>Username: <input type="text" name="username" class="textfield"
> > id="username" size="20"></p>
> > <p>Password: <input type="text" name="password" class="textfield"
> > id="password" size="20"></p>
> > <p><input type="submit" name="submit" class="form_button"><input
> > type="reset" value="Reset" name="reset"></p>
> > </form>
> > </fieldset></body>
>
> > </html>
>
> > Can someone tell me what I have done wrong, please!
>
> You don't appear to be assiging the submitted values to the variables
> that you are using in your insert statement.
>
> Try changing $name
> to $_POST['name']
> and so on.
On Nov 15, 4:30 pm, Captain Paralytic <paul_laut...@yahoo.com> wrote:
> On Nov 15, 2:21 pm, sebby....@gmail.com wrote:
>
>
>
> > if any one out there can help me with this problem I would be very
> > greatful.
>
> > I have created a database to store new registered members to my
> > website but when data is sent to my database table, the entire row is
> > blank except for the automated id number.
>
> > I have searched in many places and have not been able to resolve this
> > problem.
>
> > Below is a copy of my page, the database connection is from another
> > page for security.
>
> > <html>
>
> > <head>
> > <meta http-equiv="Content-Type" content="text/html;
> > charset=windows-1252">
> > <title>Members</title>
> > <style type="text/css">
> > <!--
> > body,td,th {
> > font-family: Georgia, Times New Roman, Times, serif;
> > font-size: 12px;}
>
> > h1 {
> > font-size: 18px;
> > padding-bottom: 2px;
> > border-bottom-width: 1px;
> > border-bottom-style: solid;
> > border-bottom-color: #CCCCCC;
> > font-style: normal;}
>
> > form {
> > margin-left: 20px;}
>
> > -->
> > </style>
> > <?php
> > require('dbConn.php');
> > ?>
> > </head>
>
> > <body>
> > <?
> > if ($_GET['mode'] == "add")
> > {
> > //////////////////////////////////Register Members to
> > DB//////////////////////////////////////////
> > $sql = "INSERT INTO members
> > (member_id,name,address,city,county,postcode,telephone,mobile,email,username,password)
> > VALUES ( '', '$name', '$address', '$city', '$county', '$postcode',
> > '$telephone', '$mobile', '$email', '$username', '$password' )";
> > if ( @mysql_query($sql) )
> > {
> > echo "<hr size=1 class=dottedlinebox class=lines> <font color=0099FF
> > face=verdana size=2>Your have succesfully registered <b><font
> > color=black>".$username."</font></b> as your account!</font><hr
> > size=1>";
> > ?>
> > <?
> > exit;
> > }else
> > {
> > echo mysql_error();
> > }
> > }
> > ?>
> > </span>
> > <?
> > echo "<h2>".$msg."</h2>";
> > ?>
>
> > <fieldset style="padding: 2">
> > <legend>Register</legend>
> > <form action="index.php?mode=add" method="post" enctype="multipart/
> > form-data" name="form">
> > <p>Name: <input type="text" name="name" class="textfield" id="name"
> > size="20"></p>
> > <p>Address: <input type="text" name="address" class="textfield"
> > id="address" size="20"></p>
> > <p>City: <input type="text" name="city" class="textfield" id="city"
> > size="20"></p>
> > <p>County: <input type="text" name="county" class="textfield"
> > id="county" size="20"></p>
> > <p>Postcode: <input type="text" name="postcode" class="textfield"
> > id="postcode" size="20"></p>
> > <p>Telephone: <input type="text" name="telephone" class="numberfield"
> > id="telephone" size="20"></p>
> > <p>Mobile: <input type="text" name="mobile" class="numberfield"
> > id="mobile" size="20"></p>
> > <p>Email: <input type="text" name="email" class="textfield"
> > id="email" size="20"></p>
> > <p>Username: <input type="text" name="username" class="textfield"
> > id="username" size="20"></p>
> > <p>Password: <input type="text" name="password" class="textfield"
> > id="password" size="20"></p>
> > <p><input type="submit" name="submit" class="form_button"><input
> > type="reset" value="Reset" name="reset"></p>
> > </form>
> > </fieldset></body>
>
> > </html>
>
> > Can someone tell me what I have done wrong, please!
>
> You don't appear to be assiging the submitted values to the variables
> that you are using in your insert statement.
>
> Try changing $name
> to $_POST['name']
> and so on.
I have not been successful in replacing but i did try something else.
I changed 'add' to send and added the following:-
<?
if ($_GET['mode'] == "send")
{
$name = $_POST['name'];
$address = $_POST['address'];
$city = $_POST['city'];
$county = $_POST['county'];
$postcode = $_POST['postcode'];
$telephone = $_POST['telephone'];
$mobile = $_POST['mobile'];
$email = $_POST['email'];
$username = $_POST['username'];
$password = $_POST['password'];
This then sent the information to the database. The database now has
actual information stored in the tables.
I thank you for your help.
Could you also help me in expanding the function of my form. I want to
be able to send an automated email to the user who filled in the form
to say that you have registered to SITE. I do not know how to begin.
Navigation:
[Reply to this message]
|