Jump to content


  • Posts

  • Joined

  • Last visited


Everything posted by john010117

  1. I don't believe there is such query for that.
  2. First of all, did you set the directory (in which the file will be upload to) to 777? Second of all, did you get any PHP errors? Try putting this: error_reporting(E_ALL); at the very top of the PHP code.
  3. 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.
  4. 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" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /><br /> <input type="submit" name="submit" value="Submit" /> </form> (you didn't put the end tag for the form). See if that helps.
  5. I detest iframes. It's not search-engine friendly. But in your case, iframes might be the solution.
  6. What exactly is the error message?
  7. Go to the main website and read the tuts there. If you are new to PHP, I suggest you start out slow.
  8. Instead of using links, make a simple form and pass the variables with the POST method instead. Ex: <form action="link.php" method="POST"> ...Form code goes here... </form>
  9. Instead of putting nothing between the quotes, use the empty() function instead. Read more about it here.
  10. 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.
  11. To clean the code up a bit... if($_POST['var']=="Something" { redirect("somewhere.php"); } else { header( 'Location: somewhere.php' ) ; } ?> Oh, and validate the $_POST info.
  12. You should have a table that contains the message ID, the actual message, and the user ID of the user that posted it. In another table, have the user list (user ID, username, etc.)
  13. <form name="form1" method="post" enctype="multipart/form-data" action="formsubmit.php?mode=add">
  14. No prob. Please mark this thread solved by clicking "solved" at the bottom of the page.
  15. //Insert new user $username = $_POST['username']; $email = $_POST['email']; $query = mysql_query("INSERT INTO `members` (username, password, email) VALUES ('$username', '$password', '$email')") or die(mysql_error()); //Close mysql mysql_close();
  16. Try this instead. If you want to custom code your site (like I do), then MySQL database(s) and PHP is the way to go.
  17. Try putting a } at the end of the code. That solves most cases.
  18. Heh, I've already asked them about that, but they are too lazy. They still have PHP 4.x installed on their servers....
  19. This doesn't belong here. Try here
  20. Replace that with this: $username = $_POST['username']; $email = $_POST['email']; $query = mysql_query ("INSERT INTO `users` (username, password, email) VALUES ('$username', '$password', '$email'") OR DIE (mysql_error()); It should work.
  21. 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.
  22. It will need your database settings, as well as the connect code. <?php // 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.
  23. Try doing this: <?php echo '<form action="check.php" method="post">';
  24. Make sure you've put: include ("settings.php"); (replacing settings.php with the file to connect to the database) BEFORE any queries.
  • 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.