Jump to content

HokieTracks

Members
  • Posts

    72
  • Joined

  • Last visited

    Never

About HokieTracks

  • Birthday 06/20/1993

Contact Methods

  • Website URL
    http://hokietracks.com

Profile Information

  • Gender
    Male
  • Location
    Virginia

HokieTracks's Achievements

Member

Member (2/5)

0

Reputation

  1. That's disappointing, thanks for the info though. I guess I'll go look into some javascript and java solutions.
  2. Does anyone know of an IE 6 CSS only compatible drop down menu? I have spent hours trying to find one that works.
  3. You could set a session variable and then check to see whether or not the session variable exists. The session variable, however, will last until they exit their browser. <?php session_start(); function ae_detect_ie() { if (isset($_SERVER['HTTP_USER_AGENT']) && (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false)) return true; else return false; } ?> <?php if(is_null($_SESSION['viewed'])){ if (ae_detect_ie()) { ?> echo "<script language='javascript'> window.location = "http://www.url.com/Ie.php" </script>"; <?php $_SESSION['viewed'] = 1; } } ?>
  4. Fair enough. My fault for assuming you were trying to be mean. Using die() blindly is bad practise. Use <?php mysql_query("INSERT INTO questions (question, answer, asker, by, date) VALUES ('$question', '$answer', '$asker', '$by', '$date')") or trigger_error("Cannot execute".mysql_error()); ?> You should really be checking to see if a query was successful. How is killing the entire script user friendly? Good point, I never actually thought about that before. Definitely something I will use in the future.
  5. Thanks for the info, no need to get mad though. I'm still learning php so I am just trying to learn as much as I can by asking questions. And, would you really rather have me use google to find an answer than use the website which you seem to be heavily involved in? I would think you would want to be a better php source than google search.
  6. Oh my bad, but I got it to work without it. I tried changing the field name of "by" to "author" and it started working. Is there some reason that mysql doesn't like "by" as a field name?
  7. Oh yeah I totally forgot about die. But enclosing my field names with ' ' didn't help. I've used date as a field name for mysql before without any problems so I don't think it could be a problem with that. I'm getting this error "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'by, date) VALUES ('sadsafads', 'fasdfsdafdsa', 'dsafdsf', 'dasfd', '2009-11-25 1' at line 1". Which doesn't make a lot of sense to me because if the syntax is right before it then why is it wrong half way through the query.
  8. I feel like an idiot because I have spent the last hour trying to figure out what is wrong with my code here. I feel like it must be a typo somewhere but I can't find one. <form action="questioninsert.php" method="post" name="question"> Asked By:<br> <input type="text" name="asker"><br><br> Answered By:<br> <input type="text" name="by"><br><br> Question:<br> <textarea cols="115" rows="20" name="question"></textarea><br><br> Answer:<br> <textarea cols="115" rows="20" name="answer"></textarea> <input type="submit" value="Post"> </form> <?php mysql_connect("localhost","*******_*****","********"); mysql_select_db("******_****"); $asker = mysql_real_escape_string(stripslashes($_POST['asker'])); $by = mysql_real_escape_string(stripslashes($_POST['by'])); $question = mysql_real_escape_string(stripslashes(nl2br(ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\">\\0</a>", $_POST['question'])))); $answer = mysql_real_escape_string(stripslashes(nl2br(ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]","<a href=\"\\0\">\\0</a>", $_POST['answer'])))); $date = mysql_real_escape_string(date("Y-m-d H:i:s")); mysql_query("INSERT INTO questions (question, answer, asker, by, date) VALUES ('$question', '$answer', '$asker', '$by', '$date')"); ?>
  9. Apparently it's a problem with Aptana because I tried uploading the folder to a different location and I got the same problem. Then I tried creating the same exact files with notepad and they work fine. Has anyone else had a problem like this with Aptana?
  10. Well in the folder there a two php files and one css file. The css file is the only one that doesn't have the error. But, going to /folder or /folder/file.php or /folder/file2.php always brings up the error. And yes there is a .htaccess in the parent folder but that only contains a redirect.
  11. Hi, I have recently been getting a 500 Server Error on my website but only in one folder and the rest work fine. I have checked my .htaccess and php.ini and everything seems fine. Anyone know why this might be happening?
  12. Ohhh, I see now. AS is putting the result into the table. I thought it was defining the result as a variable.
  13. Ok, but then how do I display "difference" in php.
  14. I am trying to find the difference between the current datetime and the datetime the user was last active. But for whatever reason the code isn't outputting anything but it doesn't have any errors either. $lastactive = $row_userdata['lastactive']; $now = date("Y-m-d H:i:s"); $activequery = "SELECT TIMEDIFF('$lastactive','$now') AS '$difference'"; mysql_query($activequery) or die(mysql_error()); echo $difference;
×
×
  • 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.