Jump to content


  • Posts

  • Joined

  • Last visited


Posts posted by john010117

  1. First of all, don't expect us to make the code for you. Post that in the freelancer section if you do.


    Second of all, the code will undoubtedly involve cookies (more on that here). If you actually get started on your code, and you are still having trouble, then you can post your specific code for any recommendations. But read some tuts first.

  2. 1) Set the directory (to which the files will upload to) permissions to 777.

    2) Replace your form to this:

    <form action="examplefileupload.php" method="post"
    <label for="file">Filename:</label>
    <input type="file" name="file" id="file" /><br />
    <input type="submit" name="submit" value="Submit" />

    (you didn't put the end tag for the form).


    See if that helps.

  3. I found one thing wrong with the code that you have now.


    if ($SessionUserID == $PhotoContribResult) {
       $PhotoContrib = 1;
       echo "User has photos posted.";
    else {
       $PhotoContrib = 0;
       echo "User does not have photos posted.";


    If you only put one equal sign on the first line, the code actually sets the variable to $PhotoContribResult. But since it's in an "if" statement, two equal signs means that the script will actually check if they are equal to each other.


    As for the session thing, read about it here.

  4. The only thing I can suggest in this very late hour is to put backticks around the table name when you're inserting the data.


    mysql_query("INSERT INTO `divers` (name, email, dive, lastd, hcert, snorkeling, passport, scubaran, scubaski, openwater, juniorow, advadven, advow, wreckd, deepd, navi, comput, nitrox, seandrec, strares, uwphoto, drysuit, boatd, fishid, hunter, bouyski, equitech, driftdiv, cavediv, divecon, asinst, instruc, advinst, divecin, scrains, iscert, advnitf, decopro, normtmx, adecpro, mord, aftd, fuldd, doutd, mdwkd, mrd, short, nidiv, helid, dextdv, rqbud, owneq, serveq, freq, eqneed, local, dclub, comm) VALUES ('$name', '$email', '$divet', '$lastd', '$hcert', '$snorkeling', '$passport', '$scubaran', '$scubaski', '$openwater', '$juniorow', '$advadven', '$advow', '$wreckd', '$deepd', '$navi', '$comput', '$nitrox', '$seandrec', '$strares', '$uwphoto', '$drysuit', '$boatd', '$fishid', '$hunter', '$bouyski', '$equitech', '$driftdiv', '$cavediv', '$divecon', '$asinst', '$instruc', '$advinst', '$divecin', '$scrains', '$iscert', '$advnitf', '$decopro', '$normtmx', '$adecpro', '$mord', '$aftd', '$fuldd', '$doutd', '$mdwkd', '$mrd', '$short', '$nidiv', '$helid', '$dextdv', '$rqbud', '$owneq', '$serveq', '$freq', '$eqneed', '$local', '$dclub', '$comm')")or die(mysql_error());


    Also, you don't have to end "?>" right before the query. So, after the variables list, it goes straight into the mysql_query. Hope that helps.

  5. It will need your database settings, as well as the connect code.


    // Connect to the database
    $host = "DB_HOST"; // db host
    $user = "DB_USERNAME"; // db username
    $pass = "DB_PASSWORD"; // db password
    $db = "DB_NAME"; // db name
    $connection = mysql_connect ($host, $user, $pass) or die ("Unable to connect"); 
    mysql_select_db ($db) or die ("Unable to select database"); 


    Make sure to replace the capitalized letters with your correct settings.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.