Jump to content

jakebur01

Members
  • Posts

    885
  • Joined

  • Last visited

Everything posted by jakebur01

  1. it is on a windows box
  2. <?php $meetingnumber=$_GET["meeting"]; $db = mysql_connect("", "", ""); mysql_select_db("", $db); $result = mysql_query("SELECT * FROM life_meeting WHERE MeetingId = '$meetingnumber'", $db); while ($myrow = mysql_fetch_array($result)) { $meetingstarttime=$myrow["Starttime"]; $meetingendtime=$myrow["Endtime"]; $meetingtype=$myrow["Type"]; $meetingclub=$myrow["Club"]; $meetingtopic=$myrow["Topic"]; $meetingusername=$myrow["Username"]; } function reformatDate($datetime) { // I am not sure how to bust up this date time---- all of this below is just guessing with the datetime list($year, $month, $day, $hour, $min, $sec) = split( '[: -]', $datetime); return "$year-$month-$day at $hour:$min"; } reformatDate($meetingstarttime); $targetYear = $year; $targetMonth = $month; $targetDay = $day; $targetHour = $hour; $targetMinute= $min; $targetSecond= $sec; $dateFormat = "Y-m-d H:i:s"; $targetDate = mktime($targetHour,$targetMinute,$targetSecond,$targetMonth,$targetDay,$targetYear); $actualDate = time(); $secondsDiff = $targetDate - $actualDate; $remainingDay = floor($secondsDiff/60/60/24); $remainingHour = floor(($secondsDiff-($remainingDay*60*60*24))/60/60); $remainingMinutes = floor(($secondsDiff-($remainingDay*60*60*24)-($remainingHour*60*60))/60); $remainingSeconds = floor(($secondsDiff-($remainingDay*60*60*24)-($remainingHour*60*60))-($remainingMinutes*60)); $targetDateDisplay = date($dateFormat,$targetDate); $actualDateDisplay = date($dateFormat,$actualDate); ?> <script type="text/javascript"> var days = <?php echo $remainingDay; ?> var hours = <?php echo $remainingHour; ?> var minutes = <?php echo $remainingMinutes; ?> var seconds = <?php echo $remainingSeconds; ?> function setCountDown () { seconds--; if (seconds < 0){ minutes--; seconds = 59 } if (minutes < 0){ hours--; minutes = 59 } if (hours < 0){ days--; hours = 23 } document.getElementById("remain").innerHTML = days+" days, "+hours+" hours, "+minutes+" minutes, "+seconds+" seconds"; setTimeout ( "setCountDown()", 1000 ); } </script> <body onLoad="setCountDown();"> <?php if($nowtime<=$meeting starttime) { //countdown and check for starttime ?> <div id="content"> <table class="countTable"> <tr><th colspan="2" id="remain"><?php echo "$remainingDay days, $remainingHour hours, $remainingMinutes minutes, $remainingSeconds seconds";?></th></tr> </table> </div> <?php /* check to see if start time yet right here*/ } else { //display chat $chat->printChat(); /* check for endtime right here and redirect to chatend.php when time has been reached. */ } ?>
  3. Ok. I have a chat that members will schedule a certain times, the chats will last one hour. On the chat page I need for it to check to see if it is chat time yet... if not then it needs to show a javascript timer counting down (which i have already)... meanwhile i need it checking using ajax to see if its chat time. Then once chat time is reached I need it to count down until the chat ends.. checking with ajax to see if the chat has ended yet, if it has I will redirect the user to another page. The mysql database table is storing the start time and end time in "datetime" columns.
  4. correction if (nowtime>=starttime) { display code now show countdown to end time check for end time using ajax, when end time is reached then header redirect to another page } else { show countdown to start time compare nowtime with starttime in mysql database using ajax when it is start time then display code now show countdown to end time check for end time using ajax, when end time is reached then header redirect to another page }
  5. I am trying to countdown to an action. I have a datetime in my mysql database for starttime and one for end time. I have searched through scripts in google but i have not found anything. Some thing like: if (nowtime>=starttime) { display code } else { show countdown to start time compare nowtime with starttime in mysql database using ajax when it is start time then display code now show countdown to end time check for end time using ajax, when end time is reached then reload page }
  6. I have a chat that I need displayed between certain times. I have a datetime column in my mysql data base that marks the start time and end time. How can I display the countdown to the chat, then display the chat code when it's time, then display a message when the chat has ended.
  7. could I just set it again rather?
  8. I have a 4 pages with forms. Each page passes data to the next. Ex. (page 1 contains personal info, page 2 contains driver info, page 3 contains vehicle info, etc.) I am turning the posted info on page 2 into sessions. My though was that if you are on page 3 and wanted to click on "personal info - page 1" to review the info or to make a change that you info would be in the blanks. I would make the default values the sessions. On page 5 all of the data is formated and e-mailed out. My problem is that when you use a session once, it is used up for good. Is their any way to make a session to where you can use it over and over without it being used up?
  9. I am trying to open a thickbox window automatically if they are not logged in. Does anyone know how to open the thickbox window automatically rather that using the link or button? Here is my authentication code: <?php if (isset($_SESSION['valid_user'])) { ?> page content here <?php } else { ?> <script type="text/javascript" src="/jquery-latest.js"></script> <script type="text/javascript" src="/thickbox.js"></script> <link rel="stylesheet" href="/thickbox.css" type="text/css" media="screen" /> </head> <body> button <input alt="#TB_inline?height=300&width=400&inlineId=myOnPageContent" title="add a caption to title attribute / or leave blank" class="thickbox" type="button" value="Show" /> or link <a href="#TB_inline?height=155&width=300&inlineId=hiddenModalContent&modal=true" class="thickbox">Show hidden modal content.</a> <?php } ?>
  10. THANK YOU!!
  11. oh I see.. So it is its own table. So if apple invited tree to be a friend you would just go ahead and store it into the table and make approved = 0. Then, if tree accepts just update approved to equal 1?
  12. could you explain this to me please? Say I have a username "tree." And "tree" adds "apple" and "orange" as friends. What would trees table look like? If it is like the previous post, would you explain how it works?
  13. I have a user site. I am trying to set it up where users can add friends. How could is store this in mysql? Would all of their friends be stored in the same field?
  14. Does anyone know of any good chat scripts that would be customizable to implement with you current users as well as custom code it to where you could have multiple chats going on at scheduled times.
  15. could i do something like: $sambo = "Visit us at <a ahef="http://www.oursite.com">"; $sambo = preg_replace ("<a ahef=", " ", $sambo); $sambo = preg_replace (">", " ", $sambo);
  16. How do I prevent people from displaying html links in their descriptions. I want to replace all html in the description with nothing before it is displayed on the website. thanks, jake
  17. That got it! Thank you!!
  18. 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 'primary = '111' or secondary = '111' or third = '111'' at line 1
  19. I am having trouble making this work. I am trying to select a row if any of the three columns matches $breed. $result3 = mysql_query("SELECT * FROM dog_account WHERE primary = '$breed' or secondary = '$breed' or third = '$breed' ", $db) or die(mysql_error());
  20. how do i cut everything off after the .com, .net. or .org example: http://clickserve.cc-dt.com/link/click?lid=41000346346356262638103 but all i want is the http://clickserve.cc-dt.com
  21. How to I extract just the url part out of a full html link? Example: the $testlink variable contains a html link $testlink = <a href="http://www.testlink.com/">Test Link</a>; How do I get just the http://www.testlink.com/ out of the link?
  22. Ok, I've stored the outputing html into a variable named $sammy. How do I seperate the <meta name="Description" content=""> from the variable? Thanks, Jake foreach( $grab->html[0] as $html ) { $sammy= htmlspecialchars( $grab->strip( $html, $config['show_tags'], $config['start_tag'], $config['end_tag'] ) ) . "<br><br>"; echo "$sammy"; }
  23. I am trying to capture the description from a remote url. I am currently retrieving the info between <head> and </head>. How do I get the ***<meta name="Description" content=""> **** information stored into a variable? $config['url'] = "http://www.walmart.com"; $config['start_tag'] = "<head>"; $config['end_tag'] = "</head>"; $config['show_tags'] = 1; class grabber { var $error = ''; var $html = ''; function grabhtml( $url, $start, $end ) { $file = file_get_contents( $url ); if( $file ) { if( preg_match_all( "#$start(.*?)$end#s", $file, $match ) ) { $this->html = $match; } else { $this->error = "Tags cannot be found."; } } else { $this->error = "Site cannot be found!"; } } function strip( $html, $show, $start, $end ) { if( !$show ) { $html = str_replace( $start, "", $html ); $html = str_replace( $end, "", $html ); return $html; } else { return $html; } } } $grab = new grabber; $grab->grabhtml( $config['url'], $config['start_tag'], $config['end_tag'] ); echo $grab->error; foreach( $grab->html[0] as $html ) { echo htmlspecialchars( $grab->strip( $html, $config['show_tags'], $config['start_tag'], $config['end_tag'] ) ) . "<br>"; }
×
×
  • 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.