Jump to content

Maq

Administrators
  • Posts

    9,363
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Maq

  1. Can we see more of your code? How do you get $INDEX? Have you tried echoing $INDEX to see what's in it? echo $INDEX; $query = "UPDATE INDEX_TEXT SET TEXT1=\"$INDEX\" WHERE ID=1"; echo $query; mysql_query($query) or die(mysql_error());
  2. Wouldn't: $days = $diff / 3600; give you hours? 60(secs)*60(minutes) = hours
  3. You should really use debugging tools. For example adding this at the top of your script: ini_set ("display_errors", "1"); error_reporting(E_ALL); and: $result = mysql_query($query) or die(mysql_error()); $num = mysql_num_rows($result) or die(mysql_error()); // you would have found this syntax error a lot faster
  4. Not sure if you can use arithmetic like this but: $sub = strtotime(07/22/2008) - strtotime(01/01/2008); //get timestamp (seconds) $sub = ($sub/3600) / 24; // get days seconds / 60*60*24 = 1 day echo int_val($sub); //round to nearest integer
  5. I guess you create a directory for every user that signs up? You should keep track of that in a database, or at least a text file. Seeing if a user has already signed up via checking if a file/dir exists is the wrong approach. You should actually check with both. Anyway, if you want to check a directory use: if (is_dir($filename)) {
  6. Maq

    forum help

    No, I understand that. I was referring to the WYSIWYG. When someone says: makes me think they're using it with the WYSIWYG editor. I guess I'm just didn't interpret what dadamssg wrote. I use Dreamweaver myself, it's great to manage bigger projects, same with NetBeans.
  7. dID YOU USE LEFT SIDE MENU VERSION/ LAYOUT I've gone through most of your site. I still feel the same way...
  8. From the looks of your site currently, it looks like you have made no attempt to use CSS. I would advise you to just keep the functionality and work strictly on style.
  9. Maq

    forum help

    I'm sorry, the code that Dreamweaver generates is awful... It doesn't even comply to W3 standards sometimes.
  10. Maq

    forum help

    Noooooooooooooooo!!! Don't do it, Dreamweaver is awful. You should learn how to code yourself and come back with questions. You will be much better off.
  11. Maq

    forum help

    Sure. As long as you're using the same database. If you look at the PHPBB examples I gave you, you will notice that all the stats are the same because they're from the same database. You would have to add some custom code, after all it is open source...
  12. Maq

    forum help

    Well most free forums have templates to choose from. You would have to go through them and find one that's similar to that look. PHPBB, for example, is an open source forum that has many many different styles to chose from. PHPBB3.0 Styles - In the upper right hand corner there's a drop down menu for styles. *** There are more styles for PHPBB 2.0
  13. Something like this perhaps? Not tested* SELECT COUNT(id), id FROM table ORDER BY COUNT(id) DESC LIMIT 5;
  14. You should use: (I think I have key and value switched...) if(isset($_POST['submit'])) { You should also just use a foreach loop for your posts instead of hardcoding each one in. For example: $errors = FALSE; foreach($_POST as $value => $key) { if(empty($value)) { $ERROR[] = "Please enter for:" . $key; $errors = TRUE; } } //$rest of your code
  15. Try this and see what exactly you're trying to INSERT: $sql = "INSERT INTO `flights` (flight_num,dep_airport,dep_icao,arr_airport,arr_icao,flight_time,dep_time,arr_time,day,route,aircraft_type,aircraft_reg) VALUES ('$FlightNum','$DepAirport','$DepICAO','$ArrAirport','$ArrICAO','$FlightTime','$DepTime','$ArrTime','$Day','$Route','$AircraftType','$AircraftReg')"; echo $sql; mysql_query($sql) or die(mysql_error());?>
  16. Okay, post your code a relevant code snippet, relevant table structure, and exactly what you want to do with each field.
  17. Why did you post this in MySQL Help? Are you extracting data from a database?
  18. Use for what? You want to assign $x to $y or do you want check if they're equal? Look at rhodesa's post.
  19. Yes, because you have elseif. If you want to evaluate each step then you need: if(blue) if(red) else
  20. If you're going to use a function you probably want to return the url not just echo it.
  21. Do you get output saying connected? Is there a reason you're using pconnect rather than connect? pconnect finds existing connections and leaves the one you just opened up. Which is good if you need it but other than that there's no real difference. Try everything in one file like this. (I changed a lot around) include("db.php"); $dbhost = 'localhost'; $dbusername = '*****'; $dbpasswd = '*****'; $database_name = 'nimbus'; $connection = mysql_connect($dbhost, $dbusername, $dbpasswd) or die ("Couldn't connect to server."); $db = mysql_select_db("$database_name", $connection) or die("Couldn't select database."); $username = (isset($_POST['myusername'])) ? $_POST['myusername'] : ""; $password = (isset($_POST['mypassword'])) ? $_POST['mypassword'] : ""; $myusername = stripslashes($myusername); $mypassword = stripslashes($mypassword); $myusername = mysql_real_escape_string($myusername); $mypassword = mysql_real_escape_string($mypassword); $sql = "SELECT * FROM $user_database_table WHERE username='$myusername' and password='$mypassword'"; $result = mysql_query($sql); $count = mysql_num_rows($result); if($count == 1) { // Register $myusername, $mypassword and redirect to file "login_success.php" session_register("myusername"); session_register("mypassword"); header("location:index.php"); } else { echo "Wrong Username or Password"; } ?>
  22. A Windows server has its equivalent in "Scheduled Tasks" lol, I didn't mean to sound like you the only thing you can do this with is a Linux server with cron jobs. Thx Mark Baker!
  23. You can never use $variable?> to display. You can use =$variable ?>, but you shouldn't. I always use : Interested to see what errors you get.
  24. Please never use short tags, , to start PHP.
  25. You wouldn't have to if there was a formula unless you wanted to keep some statistics or something. Is there a formula? There is not pattern in these numbers, and there is no function in your XSL sheet... Am I missing something?
×
×
  • 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.