how can i connect my page of "sign-up" to a database?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • reese
    New Member
    • Mar 2008
    • 8

    how can i connect my page of "sign-up" to a database?

    Help Me Please...some Ideas On Php...
    Last edited by ronverdonk; Mar 16 '08, 10:43 AM. Reason: text
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    In order to help you, provide some more information. What do you mean by 'connect my page'? And how do you want to 'connect' youyr page to a database?

    In short, explain your problem in a plain english.

    ROnald

    Comment

    • reese
      New Member
      • Mar 2008
      • 8

      #3
      Im having a problem on my page,,
      Im doing a page that will allow a person to join my group, but
      I dont know how to connect the account information they've entered.,,to my database..
      Last edited by ronverdonk; Mar 16 '08, 11:04 AM. Reason: sanitize text

      Comment

      • ronverdonk
        Recognized Expert Specialist
        • Jul 2006
        • 4259

        #4
        The only way to try to help you is that you show the code that is involved here. So show it and do not forget to enclose any code within the appropriate code tags.

        P.S. It does not help at all to write your text in capitals. They will be removed.

        Ronald

        Comment

        • reese
          New Member
          • Mar 2008
          • 8

          #5
          thanks for reminding me not to use all caps..
          should i put these two php code in a notepad??
          [php]1)
          <?php
          require("connec tion.php");
          $n=$_POST['name'];
          $sn=$_POST['surname'];
          $g=$_POST['gender'];
          $add=$_POST['address'];
          @mysql_query("I nsert into information values('" . $n . "','" . $sn . "','" . $g . "','" . $address . "')");
          ?>

          2)
          <?php
          if($x=@mysql_co nnect("localhos t","a8728531_te st","jdin04") )
          {echo"CONNECTED ";}
          else
          {echo"NOT CONNECTED";}
          $x=@mysql_selec t_db("a8728531_ endangered1");
          ?>[/php]
          Last edited by ronverdonk; Mar 16 '08, 11:31 AM. Reason: code within tags!

          Comment

          • reese
            New Member
            • Mar 2008
            • 8

            #6
            please bear on me, my errors, im still studying php...

            Comment

            • ronverdonk
              Recognized Expert Specialist
              • Jul 2006
              • 4259

              #7
              Originally posted by reese
              please bear on me, my errors, im still studying php...
              Before you continue read the Posting Guidelines, especially the part about enclosing any code with the appropriate code tags! How to Ask a Question).

              This makes it easier for our Experts to read and understand it. Failing to do so creates extra work for the moderators, thus wasting resources, otherwise available to answer the members' questions.

              Originally posted by ronverdonk
              .. So show it and do not forget to enclose any code within the appropriate code tags. ...
              I have asked that specifically.

              Ronald

              Comment

              • ronverdonk
                Recognized Expert Specialist
                • Jul 2006
                • 4259

                #8
                You have not shown all code! Where is the code of the form that is used to sign/up a new member? And this time enclose it within code tags!

                Ronald

                Comment

                • reese
                  New Member
                  • Mar 2008
                  • 8

                  #9
                  [php]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
                  <html xmlns="http://www.w3.org/1999/xhtml">
                  <head>
                  <title>endanger ed animals.com</title>
                  <style type="text/css">
                  <!--
                  body {
                  background-image: url(http://i246.photobucket.com/albums/g...z/realbg.jpg);
                  }
                  body,td,th {
                  color: #663300;
                  }
                  .style2 {
                  font-family: "Palatino Linotype";
                  font-size: 36px;
                  }
                  .style5 {font-family: "Palatino Linotype"; font-size: 18px; }
                  .style7 {
                  font-size: 16px;
                  font-weight: bold;
                  }
                  .style10 {font-family: "Palatino Linotype"; font-weight: bold; }
                  .style13 {font-size: 16px}
                  -->
                  </style></head>

                  <body>
                  o?o
                  <div align="center">
                  <blockquote>
                  <p align="left">&n bsp;</p>
                  <p align="center"> <img src="http://i246.photobucke t.com/albums/gg90/dingdongcortez/logo.jpg" align="left" width="113" height="106" /> </p>
                  <blockquote>
                  <blockquote>
                  <blockquote>
                  <p align="left"><b r />
                  <br />
                  <span class="style2"> poetspride.890m .com</span><br />
                  </p>
                  <div align="right"></div>
                  </blockquote>
                  </blockquote>
                  </blockquote>
                  </blockquote>
                  </div>
                  <blockquote>
                  <blockquote>
                  <p>&nbsp;</p>
                  <hr width="800" color="#006600" />
                  <blockquote>
                  <p class="style5"> Hi there! <br />
                  Please fill up the needed informations for you to sign up. </p>
                  </blockquote>
                  </blockquote>
                  <div align="center" class="style4">
                  <blockquote>< p align="right">< span class="style7"> Have already your account? </span><br />
                  <form action="log-inplng.html" method="post"></p>
                  <div align="right">
                  <input type="submit" name="log-in" value="Log-in" />
                  </div></form>

                  <blockquote>
                  <blockquote>
                  <div align="left">
                  <p class="style5"> 1.Tell us about yourself...</p>
                  <blockquote>
                  <form id="form2" name="form2" method="post" action="connect ion.php">
                  <div align="left">
                  <table border="0">
                  <tr><td><span class="style7"> Name:</span></td>
                  <td><input type="text" name="name" size="size"></td></tr>
                  <tr><td> <span class="style7"> Surname:</span></td>
                  <td><input type="text" name="surname" size="size" /></td></tr>
                  <tr><td><span class="style7" name="gender">G ender:</span></td>
                  <td><select size="1" multiple="multi ple" name="gender"/>
                  <option value="Select One">Select One</option>
                  <option value="Male">Ma le</option>
                  <option value="Female"> Felmale</option></td></tr>
                  <tr><td><span class="style7"> Address:</span></td>
                  <td><select size="1" name="address"/>
                  <option value="Select One ">Select one</option>
                  <option value="Afghanis tan ">Afghanist an</option>
                  <option value="Algeria" >Algeria</option>
                  <option value="Argentin a">Argentina </option>
                  <option value="Australi a">Australia </option>
                  <option value="Austria" >Austria</option>
                  <option value="Banglade sh">Banglades h</option>
                  <option value="Bolivia" > Bolivia</option>
                  <option value="Botswana ">Botswana</option>
                  <option value="Brazil"> Brazil</option>
                  <option value="Brunei"> Brunei </option>
                  <option value="Cambodia ">Cambodia </option>
                  <option value="Canada"> Canada</option>
                  <option value="China ">China </option>
                  <option value="Colombia ">Colombia</option>
                  <option value="Denmark" >Denmark</option>
                  <option value="Egypt ">Egypt </option>
                  <option value=" Finland"> Finland</option>
                  <option value="France ">France </option>
                  <option value="Germany ">Germany</option>
                  <option value="Greece"> Greece</option>
                  <option value="Hong Kong ">Hong Kong </option>
                  <option value="India ">India </option>
                  <option value="Indonesi a ">Indonesia </option>
                  <option value="Japan ">Japan </option>
                  <option value="Kenya ">Kenya </option>
                  <option value="Kuwait"> Kuwait</option>
                  <option value="Laos">La os</option>
                  <option value="Malaysia ">Malaysia </option>
                  <option value="New Zealand ">New Zealand </option>
                  <option value="Oman ">Oman </option>
                  <option value="Pakistan ">Pakistan </option>
                  <option value="Philippi nes ">Philippin es </option>
                  <option value="Qatar">Q atar</option>
                  <option value=" Russia "> Russia </option>
                  <option value=" Singapore"> Singapore</option>
                  <option value="Taiwan ">Taiwan </option>
                  <option value="United States ">United States </option>
                  <option value="Venezuel a ">Venezuela </option>
                  <option value="Wallis and Futuna ">Wallis and Futuna </option>
                  <option value=" Yemen "> Yemen </option>
                  <option value=" Zimbabwe "> Zimbabwe </option>
                  <option value="Others ">Others</option>
                  </td></tr>
                  </table>
                  </form></div>
                  <p>&nbsp;</p>

                  <div align="left">
                  <p class="style5"> 2. Create your :</p>
                  <form id="form2" name="form2" method="post" action="log-in.html">
                  <table border="0">
                  <tr><td><span class="style7"> Username:</span></td>
                  <td> <input type="text" name="username" size="size"></td></tr>
                  <tr><td><span class="style7"> Password:</span></td>
                  <td><input type="password" name="password" size="20" /></td></tr>
                  <tr><td><span class="style10" ><span class="style7"> Re-type Password</span>:</span></td>
                  <td><input type="password" name="repasswor d" size="20" /></td></tr>
                  <tr><td><inpu t type="submit" name="submit" value="Submit" /></td></tr>
                  </table>
                  </form></div>
                  </body>
                  <?php
                  require("connec tion.php");
                  $n=$_POST['name'];
                  $sn=$_POST['surname'];
                  $g=$_POST['gender'];
                  $add=$_POST['address'];
                  @mysql_query("I nsert into information values('" . $n . "','" . $sn . "','" . $g . "','" . $address . "')");
                  ?>
                  </html>[/php]
                  Last edited by ronverdonk; Mar 16 '08, 11:46 AM. Reason: code tags

                  Comment

                  • reese
                    New Member
                    • Mar 2008
                    • 8

                    #10
                    [php]<?php
                    if($x=@mysql_co nnect("localhos t","a8728531_te st","jdin04") )
                    {echo"CONNECTED ";}
                    else
                    {echo"NOT CONNECTED";}
                    $x=@mysql_selec t_db("a8728531_ endangered1");
                    ?>[/php]
                    Last edited by ronverdonk; Mar 16 '08, 11:46 AM. Reason: code tags

                    Comment

                    • reese
                      New Member
                      • Mar 2008
                      • 8

                      #11
                      the 2nd one is the content of connection.php declared in the 1st one..i wanna cry,,its not working, whatever i do and try on it..

                      Comment

                      • ronverdonk
                        Recognized Expert Specialist
                        • Jul 2006
                        • 4259

                        #12
                        After 3 warnings, you have just received your last warning by personal mail. I will close this thread until you have acknowledged that you have read the Posting Guidelines and will adhere to them.

                        This does not work the way it is constructed. You have 3 forms with action to 3 different scripts and only 2 submits. That is the first thing to clear up.
                        • you have 3 forms on 1 page:
                          • LOGIN: <form action="log-inplng.html" method="post"></p>

                          • Tell us about yourself: <form id="form2" name="form2" method="post" action="connect ion.php">
                            This one does not have a SUBMIT! You must make the second and third form ONE form.

                          • Create your : <form id="form2" name="form2" method="post" action="log-in.html">

                        what is connection.php, what is login.html and what is log-inplng.html??
                        • P.S. gender is a multiple select drop down box, but you have not close </select> the select list, so no options show. And why would you do a multiple select on gender?

                        Ronald

                        Comment

                        Working...