Results 1 to 37 of 37

Thread: Form changed to contect to database?
      
   

  1. #1
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Form changed to contect to database?

    Hi FOlks,

    I have made some changes to a form in th ehope that it will conect to mySQL.

    Although I dont get any erros the form now does not appear at all and the email address that the info was sent does not now recieve the email.

    I would appreciate some advice on how I can fix this problem or at least someone showing me wher eI am going wrong

  2. #2
    navaldesign's Avatar
    navaldesign is offline General & Forum Moderator
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    12,115

    Default Re: Form changed to contect to database?

    Rob, how can we help you withour seeing the form AND the code you used ?

    Why don't you use ABVFP ?
    Navaldesign
    Logger Lite: Low Cost, Customizable, multifeatured Login script
    Instant Download Cart: a Powerfull, Customized, in site, DB driven, e-products Cart
    DBTechnosystems.com Forms, Databases, Shopping Carts, Instant Download Carts, Loggin Systems and more....
    Advanced BlueVoda Form Processor : No coding form processor! Just install and use! Now with built in CAPTCHA!


  3. #3
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Re: Form changed to contect to database?

    Hi George,

    Thanks for the reply.

    The form is one that you created/ assisted me with a while back hence me not using ABVP.

    I have gone to MySQL and created the database as per the instructions.

    I have added some additional info to the form in the hope that it would connect to the database / MySQL. Well the result on publishing is what you see.

    This is what I inserted to my form to create this error.

    <?php
    $MySQL host="localhost";
    $MySQL username="r*****";
    $MySQL password="f*******";
    $MySQL database="eghfya_*******";

    $Gender=$_GET['Gender:'];
    $Name=$_GET['Name'];
    $Surname=$_GET['Surname:'];
    $Country=$_GET['Country:'];
    $Date_of_Birth=$_GET['Date of Birth:'];
    $Identity Number=$_GET['Identity_Number'];
    $P.O.Box=$_GET['P.O.Box'];
    $Postal Code=$_GET['Postal Code'];
    $Suburb=$_GET['Suburb'];
    $Relationship=$_GET['Relationship'];
    $Language=$_GET['Language'];
    $Gaurdians Name=$_GET['Gaurdians Name'];
    $Gauerdians Surname=$_GET['Gaurdians Surname'];
    $Cellphone=$_GET['Cellphone'];
    $Home_Phone=$_GET['Home Phone'];
    $Work Phone=$_GET['Work Phone'];
    $Fax=$_GET['Fax'];
    $email=$_GET['email'];
    $Division=$_GET['Division'];
    $Club=$_GET['Club'];
    $School=$_GET['School'];
    $Grade=$_GET['Grade'];
    $Type=$_GET['Type'];
    $Membership=$_GET['Membership'];
    $Rules=$_GET['Rules'];

    $conn1=odbc_connect($eghfya_*****,$******h,$f***** *);
    $query = ("INSERT INTO products VALUES ('', '$Gender', '$Name', '$Surname', '$Country', '$Date of Birth', '$Identity Number', '$P.O.Box', '$Postal Code', '$Suburb', '$Relationship', '$Language', '$Gaurdians Name', '$Gaurdians Surname', '$Cellphone', '$Home Phone', '$Work Phone', '$email', '$Division', '$Handicap', '$School', '$Grade', '$Type', '$Membership', '$Club', '$Rules')");
    ?>


    As you can see I am not the wizz at this type of thing but am trying in order to get somewhere.

    As usual your experiance is valued.

  4. #4
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Re: Form changed to contect to database?

    Hi George,

    When I veiw the source after publishing as per normal this is what is revealed.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252">
    <META content=WTMHMJXQED name=SKYPE_FRAMEID>
    <META content=WTMHMJXQED name=SKYPE_FRAMEID>
    <META id=skype_tb_marker_id content=metacontent
    name=SKYPE_PARSING_HAS_FINISHED></HEAD>
    <BODY></BODY></HTML>

    Maybe someone can shed some light on why this occurs?

  5. #5
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    Change your code to something like

    PHP Code:
    <?php
    $MySQLhost
    ="localhost"
    $MySQLusername="r*****"
    $MYSQLpassword="f*******"
    $MySQLdatabase="eghfya_*******";

    $dbconnect mysql_connect($MySQLhost$MySQLusername$MYSQLpassword
    or die (
    "Could not connect to mysql because ".mysql_error()); 
    mysql_select_db($MySQLdatabase
    or die (
    "Could not select database because ".mysql_error());

    $Gender=$_GET['Gender:']; 
    $Name=$_GET['Name']; 
    $Surname=$_GET['Surname:']; 
    $Country=$_GET['Country:']; 
    $Date_of_Birth=$_GET['Date of Birth:']; 
    $Identity Number=$_GET['Identity_Number']; 
    $P.O.Box=$_GET['P.O.Box']; 
    $Postal Code=$_GET['Postal Code']; 
    $Suburb=$_GET['Suburb']; 
    $Relationship=$_GET['Relationship']; 
    $Language=$_GET['Language']; 
    $Gaurdians Name=$_GET['Gaurdians Name']; 
    $Gauerdians Surname=$_GET['Gaurdians Surname']; 
    $Cellphone=$_GET['Cellphone']; 
    $Home_Phone=$_GET['Home Phone']; 
    $Work Phone=$_GET['Work Phone']; 
    $Fax=$_GET['Fax']; 
    $email=$_GET['email'];
    $Division=$_GET['Division'];
    $Club=$_GET['Club'];
    $School=$_GET['School'];
    $Grade=$_GET['Grade'];
    $Type=$_GET['Type'];
    $Membership=$_GET['Membership'];
    $Rules=$_GET['Rules'];

    $query mysql_query("INSERT INTO products VALUES ('', '$Gender', '$Name', '$Surname', '$Country', '$Date of Birth', '$Identity Number', '$P.O.Box', '$Postal Code', '$Suburb', '$Relationship', '$Language', '$Gaurdians Name', '$Gaurdians Surname', '$Cellphone', '$Home Phone', '$Work Phone', '$email', '$Division', '$Handicap', '$School', '$Grade', '$Type', '$Membership', '$Club', '$Rules')"$dbconnect); 
    ?>
    The reason that the page is blank and only has the small amount of html code is because there is no output to the PHP code. When you execute php code it's not going to display the actual code in the browser

    Also you are going to want to validate the data or at least use the addslashes() function otherwise the query will fail when someone enters an apostrophe in one of the fields, or they can do malicious things to your database

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  6. #6
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Re: Form changed to contect to database?

    Hi,

    Thanks for the reply.

    I have made the changes as requested.

    However the blank page still apprears.

    I have made additional changes in that I have removed Skype to the result that the Surce now views as:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
    <BODY></BODY></HTML>


    It must just be something silly that I cant grasp to be succesful in getting the desired result.

    Again your assitnace would be welcome?

  7. #7
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Thumbs up Re: Form changed to contect to database?

    Hi Watdaflip,

    Strangely enough though when I do a previed it shows

  8. #8
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Re: Form changed to contect to database?

    Hi FOlks,

    I have got the page back to be able to send the emails after populating the fields.

    Question 1 - how do I know whether the Datbase is being updated?

    Question 2 - Can I create a page that will present the members in a list format that only I can veiw and how easy is it?

    As a rookie that is

  9. #9
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    The reason it shows the code when you preview is because you don't have php install on your computer, so it just displays it as if it were text.

    Again its not display anything because you haven't told it to display anything. If you want to have it display a message add something like

    echo "Form submitted";

    before ?>


    Check phpmyadmin in cpanel, it will let you look at all of the data stored in your databases.

    To display the contents on a page use code like..

    PHP Code:
    <?php
    $MySQLhost
    ="localhost"
    $MySQLusername="r*****"
    $MYSQLpassword="f*******"
    $MySQLdatabase="eghfya_*******";

    $dbconnect mysql_connect($MySQLhost$MySQLusername$MYSQLpassword
    or die (
    "Could not connect to mysql because ".mysql_error()); 
    mysql_select_db($MySQLdatabase
    or die (
    "Could not select database because ".mysql_error());

     
    $select mysql_query("SELECT * FROM products"$dbconnect); 

    echo 
    '
    <table>
         <tr>
              <td>Gender</td>
              <td>Name</td>
              <td>Surname</td>
         </tr>'
    ;
    while(
    $row mysql_fetch_assoc($select))
    {
         echo 
    '
              <tr>
                   <td>'
    .$row['gender'].'</td>
                   <td>'
    .$row['name'].'</td>
                   <td>'
    .$row['surname'].'</td>
               </tr>'
    ;
    }
    echo 
    '</table>';
    ?>
    You will have to add the rest like the current ones are. In the code $row['gender'], gender should correspond with the exact column name in the database. Also make sure you do the header for the top, before the while loop

    Hope that helps

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  10. #10
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Thumbs up Re: Form changed to contect to database?

    Hi Watdaflip,

    Thanks for the inputs.

    Lik eI said I am very new to this concept and am really moving between advice from one to another in getting the final result.

    I will endevour to follow your lead and reply later

  11. #11
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Re: Form changed to contect to database?

    Hi Watdaflip,

    A question.

    In writing all this scrpit as we have done.

    Do I paste this info on my page and where about must it be posted exactly.

    This could also be a major part of my problem in that I am not placing it in the correct place.

  12. #12
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    This particular script you can place anywhere. Just copy and paste it in a html box, publish as a php file, and your set.

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  13. #13
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Re: Form changed to contect to database?

    Hi,

    Thanks for the reply.

    Thats a blessing as I had visions of starting this all over

  14. #14
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Re: Form changed to contect to database?

    Hi Watdaflip,

    I have made all the changes as suggested.

    The emailing portion working fine.

    The visual of the table outside MySql nothing seen.

    I cant see the info in my Members datbase once I have submitted

  15. #15
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    Post the code you are currently using (you can censor the db password and stuff) but make sure the queries are unaltered.

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  16. #16
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Thumbs up Re: Form changed to contect to database?

    Hi Watdaflip,

    Thanks again for your support. It is most appreciated.

    Herewith the details requested.

    <?php
    $MySQLhost="localhost";
    $MySQLusername="r0berth";
    $MySQLpassword="f0undat10n";
    $MySQLdatabase="eghfya_members";
    $dbconnect = mysql_connect($MySQLhost,$MySQLusername,$MySQLpass word)
    or die ("Could not connect to mysql because ".mysql_error());
    mysql_select_db($MySQLdatabase)
    or die ("Could not select database because ".mysql_error());
    $select = mysql_query("SELECT * FROM MEMBERS", $dbconnect);
    echo '
    <table>
    <tr>
    <td>Gender</td>
    <td>Name</td>
    <td>Surname</td>
    <td>Country</td>
    <td>Date_of_Birth</td>
    <td>Identity_No</td>
    <td>P_O_Box</td>
    <td>Suburb</td>
    <td>Postal_Code</td>
    <td>Relationship</td>
    <td>Language</td>
    <td>Gaurdians_Name</td>
    <td>Gaurdians_Surname</td>
    <td>Cell_Phone</td>
    <td>Home_phone</td>
    <td>Work_phone</td>
    <td>Fax</td>
    <td>email</td>
    <td>Division</td>
    <td>Home_Club</td>
    <td>Handicap</td>
    <td>School</td>
    <td>Grade</td>
    <td>Type</td>
    <td>Membership</td>
    <td>Rules</td>
    </tr>';
    while($row = mysql_fetch_assoc($select))
    {
    echo '
    <tr>
    <td>'.$row['Gender'].'</td>
    <td>'.$row['Name'].'</td>
    <td>'.$row['Surname'].'</td>
    <td>'.$row['Country'].'</td>
    <td>'.$row['Date_of_Birth'].'</td>
    <td>'.$row['Identity_No'].'</td>
    <td>'.$row['P_O_Box'].'</td>
    <td>'.$row['Suburb'].'</td>
    <td>'.$row['Postal_Code'].'</td>
    <td>'.$row['Relationship'].'</td>
    <td>'.$row['Language'].'</td>
    <td>'.$row['Gaurdians_Name'].'</td>
    <td>'.$row['Gaurdians_Surname'].'</td>
    <td>'.$row['Cell_Phone'].'</td>
    <td>'.$row['Home_phone'].'</td>
    <td>'.$row['Work_phone'].'</td>
    <td>'.$row['Fax'].'</td>
    <td>'.$row['email'].'</td>
    <td>'.$row['Division'].'</td>
    <td>'.$row['Home_Club'].'</td>
    <td>'.$row['Handicap'].'</td>
    <td>'.$row['School'].'</td>
    <td>'.$row['Grade'].'</td>
    <td>'.$row['Type'].'</td>
    <td>'.$row['Membership'].'</td>
    <td>'.$row['Rules'].'</td>
    </tr>';
    }
    echo '</table>';
    $Gender=$_GET['Gender:'];
    $Name=$_GET['Name'];
    $Surname=$_GET['Surname:'];
    $Country=$_GET['Country:'];
    $Date_of_Birth=$_GET['Date_of_Birth:'];
    $Identity_No=$_GET['Identity_No'];
    $P_O_Box=$_GET['P_O_Box'];
    $Postal_Code=$_GET['Postal_Code'];
    $Suburb=$_GET['Suburb'];
    $Relationship=$_GET['Relationship'];
    $Language=$_GET['Language'];
    $Gaurdians_Name=$_GET['Gaurdians_Name'];
    $Gaurdians_Surname=$_GET['Gaurdians_Surname'];
    $Cell_Phone=$_GET['Cell_Phone'];
    $Home_phone=$_GET['Home_phone'];
    $Work_phone=$_GET['Work_phone'];
    $Fax=$_GET['Fax'];
    $email=$_GET['email'];
    $Division=$_GET['Division'];
    $Home_Club=$_GET['Home_Club'];
    $School=$_GET['School'];
    $Grade=$_GET['Grade'];
    $Type=$_GET['Type'];
    $Membership=$_GET['Membership'];
    $Rules=$_GET['Rules'];
    $Rules=$_GET['Handicap'];




    $query = mysql_query("INSERT INTO MEMBERS VALUES ('', '$Gender', '$Name', '$Surname', '$Country', '$Date_of_Birth', '$Identity_No', '$P_O_Box', '$Postal_Code', '$Suburb', '$Relationship', '$Language', '$Gaurdians_Name', '$Gaurdians_Surname', '$Cell_Phone', '$Home_phone', '$Work_phone', '$email', '$Division', '$Handicap', '$School', '$Grade', '$Type', '$Membership', '$Home_Club', '$Fax', '$Rules')", $dbconnect);
    echo "Form submitted";
    ?>

  17. #17
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    Ok, you need to have the database connection at the top (everything before the line that starts with $select) and everything after $Gender=$_GET['Gender']; included in the script that is sending the email.

    Also I don't know if you are using a get or post method with your form, but you may need to change all instances of _GET to _POST, if you give me a link to the form I will let you know.

    And the code that displays the contents of the database (which looks like you did correctly) would probably be best to have on its own page (which I guess it will be when you remove the insert query.. but make sure you leave the database connection for both)

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  18. #18
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Thumbs up Re: Form changed to contect to database?

    Hi Watdaflip,

    Thanks again.

    Slowly but surely I am making progress.

    Please inform me as to how I get the section after $Gender . . . inccluded in the script that is sending the mail?

    I would like to create a totally new page to present the results of the membership. That page could be called GNJGFMem. This page is not yet created.

  19. #19
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    I wasn't sure what you were saying so I copy and modified it to be two different scritps. The first of what you need to add to your email script. If you created that using the form wizard you will have to open the php processing file for that form and insert the code there (afer the mail() function).

    The second is for the display, you can just copy and paste that into a html box and publish.

    PHP Code:
    <?php
    $MySQLhost
    ="localhost"
    $MySQLusername="r0berth"
    $MySQLpassword="f0undat10n"
    $MySQLdatabase="eghfya_members"
    $dbconnect mysql_connect($MySQLhost,$MySQLusername,$MySQLpass  word
    or die (
    "Could not connect to mysql because ".mysql_error()); 
    mysql_select_db($MySQLdatabase
    or die (
    "Could not select database because ".mysql_error());

    $Gender=$_GET['Gender:']; 
    $Name=$_GET['Name']; 
    $Surname=$_GET['Surname:']; 
    $Country=$_GET['Country:']; 
    $Date_of_Birth=$_GET['Date_of_Birth:']; 
    $Identity_No=$_GET['Identity_No']; 
    $P_O_Box=$_GET['P_O_Box']; 
    $Postal_Code=$_GET['Postal_Code']; 
    $Suburb=$_GET['Suburb']; 
    $Relationship=$_GET['Relationship']; 
    $Language=$_GET['Language']; 
    $Gaurdians_Name=$_GET['Gaurdians_Name']; 
    $Gaurdians_Surname=$_GET['Gaurdians_Surname']; 
    $Cell_Phone=$_GET['Cell_Phone']; 
    $Home_phone=$_GET['Home_phone']; 
    $Work_phone=$_GET['Work_phone']; 
    $Fax=$_GET['Fax']; 
    $email=$_GET['email'];
    $Division=$_GET['Division'];
    $Home_Club=$_GET['Home_Club'];
    $School=$_GET['School'];
    $Grade=$_GET['Grade'];
    $Type=$_GET['Type'];
    $Membership=$_GET['Membership'];
    $Rules=$_GET['Rules'];
    $Rules=$_GET['Handicap'];
     
    $query mysql_query("INSERT INTO MEMBERS VALUES ('', '$Gender', '$Name', '$Surname', '$Country', '$Date_of_Birth', '$Identity_No', '$P_O_Box', '$Postal_Code', '$Suburb', '$Relationship', '$Language', '$Gaurdians_Name', '$Gaurdians_Surname', '$Cell_Phone', '$Home_phone', '$Work_phone', '$email', '$Division', '$Handicap', '$School', '$Grade', '$Type', '$Membership', '$Home_Club', '$Fax', '$Rules')"$dbconnect);

    ?>
    PHP Code:
    <?php
    $MySQLhost
    ="localhost"
    $MySQLusername="r0berth"
    $MySQLpassword="f0undat10n"
    $MySQLdatabase="eghfya_members"
    $dbconnect mysql_connect($MySQLhost,$MySQLusername,$MySQLpass  word
    or die (
    "Could not connect to mysql because ".mysql_error()); 
    mysql_select_db($MySQLdatabase
    or die (
    "Could not select database because ".mysql_error());
    $select mysql_query("SELECT * FROM MEMBERS"$dbconnect); 
    echo 
    '
    <table>
    <tr>
    <td>Gender</td>
    <td>Name</td>
    <td>Surname</td>
    <td>Country</td>
    <td>Date_of_Birth</td>
    <td>Identity_No</td>
    <td>P_O_Box</td>
    <td>Suburb</td>
    <td>Postal_Code</td>
    <td>Relationship</td>
    <td>Language</td>
    <td>Gaurdians_Name</td>
    <td>Gaurdians_Surname</td>
    <td>Cell_Phone</td>
    <td>Home_phone</td>
    <td>Work_phone</td>
    <td>Fax</td>
    <td>email</td>
    <td>Division</td>
    <td>Home_Club</td>
    <td>Handicap</td>
    <td>School</td>
    <td>Grade</td>
    <td>Type</td>
    <td>Membership</td>
    <td>Rules</td>
    </tr>'
    ;
    while(
    $row mysql_fetch_assoc($select))
    {
    echo 
    '
    <tr>
    <td>'
    .$row['Gender'].'</td>
    <td>'
    .$row['Name'].'</td>
    <td>'
    .$row['Surname'].'</td>
    <td>'
    .$row['Country'].'</td>
    <td>'
    .$row['Date_of_Birth'].'</td>
    <td>'
    .$row['Identity_No'].'</td>
    <td>'
    .$row['P_O_Box'].'</td>
    <td>'
    .$row['Suburb'].'</td>
    <td>'
    .$row['Postal_Code'].'</td>
    <td>'
    .$row['Relationship'].'</td>
    <td>'
    .$row['Language'].'</td>
    <td>'
    .$row['Gaurdians_Name'].'</td>
    <td>'
    .$row['Gaurdians_Surname'].'</td>
    <td>'
    .$row['Cell_Phone'].'</td>
    <td>'
    .$row['Home_phone'].'</td>
    <td>'
    .$row['Work_phone'].'</td>
    <td>'
    .$row['Fax'].'</td>
    <td>'
    .$row['email'].'</td>
    <td>'
    .$row['Division'].'</td>
    <td>'
    .$row['Home_Club'].'</td>
    <td>'
    .$row['Handicap'].'</td>
    <td>'
    .$row['School'].'</td>
    <td>'
    .$row['Grade'].'</td>
    <td>'
    .$row['Type'].'</td>
    <td>'
    .$row['Membership'].'</td>
    <td>'
    .$row['Rules'].'</td>
    </tr>'
    ;
    }
    echo 
    '</table>';
    ?>

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  20. #20
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Thumbs up Re: Form changed to contect to database?

    Hi Watdaflip,

    Thanks again for all your time.

    I have psoted the second file (PHP) into my page - anywhere as suggested.

    I have looked fro the "mail ()" function to no avail and in my search have found the following:

    Parents and supporters</b> are encouraged to enrol here entiling them to voice and vote in the affairs of the Division</font></div>
    <div id="bv_" style="position:absolute;left:0px;top:1px;width:64 5px;height:526px;z-index:83" align="left">
    <form name="application" method="POST" action="<? echo($_SERVER['PHP_SELF']);?>" enctype="multipart/form-data" id="" onsubmit="return Validateapplication(this)"

    >
    <div id="bv_Text11" style="position:absolute;left:89px;top:270px;width :68px;height:14px;z-index:0" align="center">
    <font style="font-size:11px" color="#7F7F7F" face="Arial">YYYYMMDD</font></div>


    My thinking is that it could be somewhere here that the first form should be installed.

    The email form uses Naval's form which uses a built in php form processor so form me you can see it is pretty awkward to find.

  21. #21
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    The action of the form is the file itself, so the code should be somewhere on the page. If you open it in the file manager or download it to your comptuer and open it in notepad, it should have the code to send the email. Find where that is and that should help you locate the code in the bv file.

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  22. #22
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Thumbs up Re: Form changed to contect to database?

    Hi Watdaflip,

    I am sorry if I cant explain myself in design terms and I am sure we could be further if I could have. Thanks for your patience.

    I have published the page at www.gnjgf.co.za/application.php and then veiwed source to look for the line you are indicating.

    Is this the wrong method?

    If it is I am not sure to the method you are proposing.

    I look forward to your reply

  23. #23
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    Are you viewing the source in your browser? If so it will process and remove all of the php code and replace it with output if there is any. In order to see the php code you would either need to download it via ftp and open it, go to your file manager and edit the file to see all the html and php code, or to find it whereever it may have been entered in BV.

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  24. #24
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Re: Form changed to contect to database?

    Hi Watdaflip,

    I have downloaded the .php and veiwed opening with notebook to find something like this

    $message .= "\nThe following file have been uploaded:\n";
    for ($i = 0; $i < count($upload_SrcName); $i++)
    {
    $message .= $upload_SrcName[$i] . " Link: " . $uploadlink[$i] . "\n";
    }
    }
    mail($mailto, $subject, stripslashes($message), $header);
    header('Location: '.$success_url);
    exit;


    I guess this must be the spot to load it to and then save and the upload using FTP?

  25. #25
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    Correct, you can add it directly before or after the mail() function. I am not sure what the $uploadlink[] array is, it may or may not work with how the code is now. But give it a try and see if it works.

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  26. #26
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Cool Re: Form changed to contect to database?

    Hi Watdaflip,

    I have cut and pasted the options - then used the FTP back to its original posting.

    It now gives me the blank screeen again.

  27. #27
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    You could be getting an error, change the query from

    PHP Code:
    $query mysql_query("INSERT INTO MEMBERS VALUES ('', '$Gender', '$Name', '$Surname', '$Country', '$Date_of_Birth', '$Identity_No', '$P_O_Box', '$Postal_Code', '$Suburb', '$Relationship', '$Language', '$Gaurdians_Name', '$Gaurdians_Surname', '$Cell_Phone', '$Home_phone', '$Work_phone', '$email', '$Division', '$Handicap', '$School', '$Grade', '$Type', '$Membership', '$Home_Club', '$Fax', '$Rules')"$dbconnect); 
    to

    PHP Code:
    $query mysql_query("INSERT INTO MEMBERS VALUES ('', '$Gender', '$Name', '$Surname', '$Country', '$Date_of_Birth', '$Identity_No', '$P_O_Box', '$Postal_Code', '$Suburb', '$Relationship', '$Language', '$Gaurdians_Name', '$Gaurdians_Surname', '$Cell_Phone', '$Home_phone', '$Work_phone', '$email', '$Division', '$Handicap', '$School', '$Grade', '$Type', '$Membership', '$Home_Club', '$Fax', '$Rules')"$dbconnect) or die(mysql_error()); 

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  28. #28
    simplyjul's Avatar
    simplyjul is offline Private First Class
    Join Date
    Dec 2007
    Posts
    5

    Default Re: Form changed to contect to database?

    I am reading this question and answer portion and i am so excited to hear that ROB solve his problem. I have not use any complicated form in my web page yet but soon i will, and when the time comes i'm sure will look for the name "WATDAFLIP" if its ok with him! Good luck guys....

  29. #29
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Re: Form changed to contect to database?

    Hi Watdaflip,

    Not good news I am afraid.

    No change.

  30. #30
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    Hmm, send me an email (admin @ [this username].com) and attach the complete file and I will take a look.

    @simplejul I will do my best to help

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  31. #31
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Thumbs up Re: Form changed to contect to database?

    Hi Watdaflip,

    Thanks for your offer to help.

    I have tried various variations of the email you sugested. it returns with a system error and the mail could not be delivered.

    Please check my website http://www.gnjgf.co.za/ out and send and email through the feedback section and I will be sure to get your email.

  32. #32
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    Alright I contacted you via your feedback form.

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  33. #33
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Re: Form changed to contect to database?

    Hi There,

    Havent received anything as yet.

    Maybe the server is slow.

  34. #34
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    Hmm, try contacting me through mine.
    http://watdaflip.net/contact.php

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  35. #35
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Re: Form changed to contect to database?

    Hi Folks,

    I have managed to get my page www.gnjgf.co.za/GolfMembers.html to look ok yet need to find out if this information below is correct will populate the page ?


    <!--------------------------------------------------------------------->
    <! THIS SECTION CHANGES WHAT THE TABLE LOOKS LIKE >
    <!--------------------------------------------------------------------->

    <table border=3 width="35%" cellspacing=0 style="background-color:#FFFFFF;">

    <!--------------------------------------------------------------------->
    <!MAKE CHANGES TO THIS SECTION IF YOU WANT THE PAGE HEADING/s TO CHANGE>
    <!--------------------------------------------------------------------->

    <caption>
    <font style>&nbsp</font>
    </caption>
    <caption>
    <b><font style="font-size:20px" color="#00008B" face="Arial">
    GAUTENG NORTH JUNIOR GOLF FOUNDATION</font><b>
    </caption>
    <caption>
    <font style="font-size:16px" color="#00008B" face="Arial">
    MEMBERSHIP LIST</font>
    </caption>
    <caption>
    <font style>&nbsp</font>
    </caption>

    <!--------------------------------------------------------------------->
    <! CHANGE COLUMN HEADING/s OF THE TABLE HERE >
    <!--------------------------------------------------------------------->

    <tr>
    <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">SURNAME</font></b></td></th>
    <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">NAME</font></b></td></th>
    <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">DATE OF BIRTH</font></b></td></th>
    <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">IDENTITY NO.</font></b></td></th>
    <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">CELL PHONE</font></b></td></th>
    <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">HOME PHONE</font></b></td></th>
    <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">WORK PHONE</font></b></td></th>
    <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">&nbsp &nbsp FAX &nbsp &nbsp</font></b></td></th>
    <th><td align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">E-MAIL</font></b></td></th>
    </tr>

    <!--------------------------------------------------------------------->
    <! THIS SECTION IS WHAT CALLS IT FROM THE DATABASE TABLE >
    <!--------------------------------------------------------------------->

    <?
    $MySQLhost="local****";
    $MySQLusername="******h";
    $MySQLpassword="f********n";
    $MySQLdatabase="egh***_members";
    $dbconnect = mysql_connect($MySQLhost,$MySQLusername,$MySQLpass word)
    or die ("Could not connect to mysql because ".mysql_error());
    mysql_select_db($MySQLdatabase)
    or die ("Could not select database because ".mysql_error());

    $Surname=.$_POST['Surname'].;
    $Name=.$_POST['Name'].;
    $Date of Birth=.$_POST['Date_of_Birth'].;
    $Identity Number=.$_POST['Identity_No'].;
    $Cell_Phone=.$_POST['Cell_Phone'].;
    $Home_Phone=.$_POST['Home_phone'].;
    $Work Phone=.$_POST['Work_phone'].;
    $Fax=.$_POST['Fax'].;
    $Email=.$_POST['Email'];
    $query = mysql_query("INSERT INTO MEMBERS (Surname, Name, Date_of_Birth, Identity_No, Cell_Phone, Home_phone, Work_phone, Fax, email)
    VALUES
    ('$Surname','$Name','$Date_of_Birth','$Identity_No ','$Cell_Phone', '$Home_phone','$Work_phone','$Fax','$email')", $dbconnect);
    exit;
    }
    ?>




  36. #36
    Watdaflip's Avatar
    Watdaflip is offline Major General
    Join Date
    Sep 2005
    Location
    Cincinnati, Ohio
    Posts
    2,119

    Default Re: Form changed to contect to database?

    Hey Rob,

    No it's not going to give the desired results. The table needs tweaking and it still has the insert query (it will just keep adding blank records to the database, not display them).

    Try this
    PHP Code:
    <!--------------------------------------------------------------------->
    <!MAKE CHANGES TO THIS SECTION IF YOU WANT THE PAGE HEADING/s TO CHANGE>
    <!--------------------------------------------------------------------->
     
    <caption>
    <font style>&nbsp</font>
    </caption>
    <caption>
    <b><font style="font-size:20px" color="#00008B" face="Arial">
    GAUTENG NORTH JUNIOR GOLF FOUNDATION</font><b>
    </caption>
    <caption>
    <font style="font-size:16px" color="#00008B" face="Arial">
    MEMBERSHIP LIST</font>
    </caption>
    <caption>
    <font style>&nbsp</font>
    </caption>

    <!--------------------------------------------------------------------->
    <! THIS SECTION CHANGES WHAT THE TABLE LOOKS LIKE >
    <!--------------------------------------------------------------------->
     
    <table border=3 width="35%" cellspacing=0 style="background-color:#FFFFFF;">
     
    <!--------------------------------------------------------------------->
    <!         CHANGE COLUMN HEADING/s OF THE TABLE HERE         >
    <!--------------------------------------------------------------------->
     
    <tr>
    <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">SURNAME</font></b></th>
    <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">NAME</font></b></th>
    <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">DATE OF BIRTH</font></b></th>
    <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">IDENTITY NO.</font></b></th>
    <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">CELL PHONE</font></b></th>
    <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">HOME PHONE</font></b></th>
    <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">WORK PHONE</font></b></th>
    <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">&nbsp &nbsp FAX &nbsp &nbsp</font></b></th>
    <th align="center" valign="middle" width="100" height="30"><b><font style="font-size:10px" color="#00008B" face="Arial">E-MAIL</font></b></th>
    </tr>
     
    <!--------------------------------------------------------------------->
    <! THIS SECTION IS WHAT CALLS IT FROM THE DATABASE TABLE >
    <!--------------------------------------------------------------------->
     
    <?
    $MySQLhost
    ="local****"
    $MySQLusername="******h"
    $MySQLpassword="f********n"
    $MySQLdatabase="egh***_members"
    $dbconnect mysql_connect($MySQLhost,$MySQLusername,$MySQLpass  word
    or die (
    "Could not connect to mysql because ".mysql_error()); 
    mysql_select_db($MySQLdatabase
    or die (
    "Could not select database because ".mysql_error());
     
    $select mysql_query("SELECT Surname, Name, Date_of_Birth, Identity_No, Cell_Phone, Home_phone, Work_phone, Fax, email FROM MEMBERS"$dbconnect);
     while(
    $row mysql_fetch_assoc($select))
    {

    echo 
    '
    <tr>
    <td>'
    .$row['Surname'].'</td>
    <td>'
    .$row['Name'].'</td>
    <td>'
    .$row['Date_of_Birth'].'</td>
    <td>'
    .$row['Identity_No'].'</td>
    <td>'
    .$row['Cell_Phone'].'</td>
    <td>'
    .$row['Home_phone'].'</td>
    <td>'
    .$row['Work_phone'].'</td>
    <td>'
    .$row['Fax'].'</td>
    <td>'
    .$row['email'].'</td>
    </tr>'
    ;
    }
    ?>
    </table>

    Register/Login Script
    Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script

  37. #37
    Rob (SA)'s Avatar
    Rob (SA) is offline Lieutenant Colonel
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    580

    Question Re: Form changed to contect to database?

    Hi Folks,

    I have eventually managed to get the page to populate and this can be seen at www.gnjgf.co.za/entryformmysql.php

    The screen fills up great but I now have some other challenges I have to overcome.

    1. How do I prevent duplication of entries on my form at www.gnjgf.co.za/entryform.php?
    2. How do I get the text to appear in smaller text than the column headings and not not show exactly whats in the table?
    This would be starters to get a better look and feel and any comments here would be most welcome

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49